Ejemplo n.º 1
0
    def test_convert_directory2(self):

        tmp_output_dir = tempfile.mkdtemp()
        try:
            convert_directory.convert_directory("/Users/abrys/Downloads/dicom_T1_UNKNOWN_2",
                                                "/Users/abrys/Downloads")

        finally:
            shutil.rmtree(tmp_output_dir)
Ejemplo n.º 2
0
    def test_convert_directory(self):

        tmp_output_dir = tempfile.mkdtemp()
        try:
            convert_directory.convert_directory(test_data.GENERIC_ANATOMICAL, tmp_output_dir)
            assert os.path.isfile(os.path.join(tmp_output_dir, '4_dicom2nifti.nii.gz'))

        finally:
            shutil.rmtree(tmp_output_dir)
Ejemplo n.º 3
0
    def test_convert_directory2(self):

        tmp_output_dir = tempfile.mkdtemp()
        try:
            convert_directory.convert_directory("/Users/abrys/Downloads/test",
                                                "/Users/abrys/Downloads")

        finally:
            shutil.rmtree(tmp_output_dir)
Ejemplo n.º 4
0
    def test_convert_dti_12(self):

        tmp_output_dir = tempfile.mkdtemp()
        os.makedirs('/Users/abrys/Documents/data/dcm2nii_dti/results/JB_b700', exist_ok=True)
        try:
            convert_directory.convert_directory('/Users/abrys/Documents/data/dcm2nii_dti/JB_b700',
                                                '/Users/abrys/Documents/data/dcm2nii_dti/results/JB_b700')

        finally:
            shutil.rmtree(tmp_output_dir)
Ejemplo n.º 5
0
    def test_convert_directory2(self):

        tmp_output_dir = tempfile.mkdtemp()
        try:
            import pydicom
            # headers = pydicom.read_file("/Users/abrys/Downloads/failing_cases/test.dcm")
            convert_directory.convert_directory("/Users/abrys/Downloads/Agfa",
                                                "/Users/abrys/Downloads/Agfa")

        finally:
            shutil.rmtree(tmp_output_dir)
Ejemplo n.º 6
0
    def test_convert_directory3(self):

        tmp_output_dir = tempfile.mkdtemp()
        try:
            import pydicom
            settings.disable_validate_slicecount()
            convert_directory.convert_directory(
                "/Users/abrys/Downloads/single_slice",
                "/Users/abrys/Downloads/single_slice")

        finally:
            shutil.rmtree(tmp_output_dir)
Ejemplo n.º 7
0
    def test_convert_dti_12(self):

        tmp_output_dir = tempfile.mkdtemp()
        os.makedirs('/Users/abrys/Documents/data/dcm2nii_dti/results/JB_b700',
                    exist_ok=True)
        try:
            convert_directory.convert_directory(
                '/Users/abrys/Documents/data/dcm2nii_dti/JB_b700',
                '/Users/abrys/Documents/data/dcm2nii_dti/results/JB_b700')

        finally:
            shutil.rmtree(tmp_output_dir)
Ejemplo n.º 8
0
    def test_convert_directory(self):

        tmp_output_dir = tempfile.mkdtemp()
        try:
            settings.enable_resampling()
            settings.set_resample_spline_interpolation_order(1)
            settings.set_resample_padding(-1000)
            settings.disable_validate_slice_increment()
            settings.disable_validate_orthogonal()
            convert_directory.convert_directory("/Users/abrys/Downloads/dicom_CT_UNKNOWN_3",
                                                "/Users/abrys/Downloads")

        finally:
            shutil.rmtree(tmp_output_dir)
Ejemplo n.º 9
0
    def test_convert_directory(self):

        tmp_output_dir = tempfile.mkdtemp()
        try:
            settings.enable_resampling()
            settings.set_resample_spline_interpolation_order(1)
            settings.set_resample_padding(-1000)
            settings.disable_validate_slice_increment()
            settings.disable_validate_orthogonal()
            convert_directory.convert_directory("/Users/abrys/Downloads/test",
                                                "/Users/abrys/Downloads")

        finally:
            shutil.rmtree(tmp_output_dir)
Ejemplo n.º 10
0
        tmp_output_dir = tempfile.mkdtemp()
        try:
            import pydicom
            # headers = pydicom.read_file("/Users/abrys/Downloads/failing_cases/test.dcm")
            convert_directory.convert_directory("/Users/abrys/Downloads/Agfa",
                                                "/Users/abrys/Downloads/Agfa")

        finally:
            shutil.rmtree(tmp_output_dir)

    def test_convert_directory3(self):

        tmp_output_dir = tempfile.mkdtemp()
        try:
            import pydicom
            settings.disable_validate_slicecount()
            convert_directory.convert_directory(
                "/Users/abrys/Downloads/single_slice",
                "/Users/abrys/Downloads/single_slice")

        finally:
            shutil.rmtree(tmp_output_dir)


if __name__ == '__main__':
    convert_directory.convert_directory("/Users/abrys/Downloads/Agfa",
                                        "/Users/abrys/Downloads/Agfa")

    # unittest.main()
Ejemplo n.º 11
0
def main():
    print('TEST')

    convert_directory.convert_directory("/Users/abrys/Downloads/Agfa",
                                        "/Users/abrys/Downloads/Agfa")