diff --git a/CBCTCardiacSegmentation/Registration.py b/CBCTCardiacSegmentation/Registration.py index 9486b2e..8c7e8e2 100644 --- a/CBCTCardiacSegmentation/Registration.py +++ b/CBCTCardiacSegmentation/Registration.py @@ -28,7 +28,7 @@ def __init__(self, RegOutputDir='', ParamDir='', RigidParamFile='', NonRigidPara if platform.system() == 'Linux': assert not(not ElastixDir),'Directory to elastix bin/lib files needs to be added for linux' - assert Path(os.path.join(ElastixDir,'bin','elastix')).exists(), 'Elastix Cannot be found at {}'.format(os.path.join(ElastixDir,'bin','elastix.exe')) + assert Path(os.path.join(ElastixDir,'bin','elastix')).exists(), 'Elastix Cannot be found at {}'.format(os.path.join(ElastixDir,'bin','elastix')) self.ElastixDir = ElastixDir diff --git a/tests/test_CBCT_Segmentation.py b/tests/test_CBCT_Segmentation.py index 25b320f..f2e7514 100644 --- a/tests/test_CBCT_Segmentation.py +++ b/tests/test_CBCT_Segmentation.py @@ -6,6 +6,7 @@ """ import os +import glob import subprocess from pathlib import Path import sys @@ -28,7 +29,7 @@ from CBCTCardiacSegmentation.CreateCBCTSegmentations import CreateCBCTSegmentations from CBCTCardiacSegmentation.SegUtil import DoDicomProcessing from CBCTCardiacSegmentation.DicomHelper import WriteDicomStructs - +""" def test_DicomProcessing(): # Download the test data data_path = get_lung_dicom() @@ -113,7 +114,7 @@ def test_BadSegMethodInput(): rmtree(data_path) rmtree(OutputDir) - +""" def test_NiftiCBCTSegmentationGeneration(): # Download the test data @@ -123,7 +124,8 @@ def test_NiftiCBCTSegmentationGeneration(): test_pat_path = data_path.joinpath("LCTSC-Test-S1-201") test_pat_path2 = data_path.joinpath("LCTSC-Test-S1-101") - SegmentationMethods = ['Direct','Synthetic','Transform']#,'Test'] + #SegmentationMethods = ['Direct','Synthetic','Transform']#,'Test'] + SegmentationMethods = ['Synthetic','Transform','Direct']#,'Test'] #Use CT images to test functionality until we can get open source CBCT images CBCTDir = str(test_pat_path2.joinpath("IMAGES/LCTSC_TEST_S1_101_0_CT_0.nii.gz")) #Is a nifti file @@ -135,6 +137,10 @@ def test_NiftiCBCTSegmentationGeneration(): home_dir = Path(os.path.expanduser('~')) # may have to update for github system elastix_dir = home_dir / 'ElastixDownload' / 'elastix-5.0.1-linux' + assert Path(elastix_dir).exists(),'Elastix directory {} does not exist'.format(elastix_dir) + + print(glob.glob(os.path.join(elastix_dir,'*'))) + for SegMethod in SegmentationMethods: print(SegMethod) OutputDir = './CBCTSegmentations' @@ -193,7 +199,7 @@ def test_DicomCBCTSegmentationGeneration(): rmtree(OutputDir) """ - +""" def test_NiftiToDicomStruct(): data_path = get_lung_dicom() @@ -216,3 +222,4 @@ def test_NiftiToDicomStruct(): rmtree(data_path) rmtree(OutputDir) +""" \ No newline at end of file