sbonaretti / pyKNEEr

An image analysis workflow for open and reproducible research on femoral knee cartilage
https://sbonaretti.github.io/pyKNEEr/
GNU General Public License v3.0
32 stars 11 forks source link

Preprocessing Saving Images #4

Closed MatthewKoffPhD closed 4 years ago

MatthewKoffPhD commented 4 years ago

Hi,

I'm going through the tutorial, starting with preprocessing, but it appears that subdirectories are not being created in Step 0: read the dicom images

My mage_list_preprocessing.txt file looks like this: C:/temp/demo_knee/inputs/original 01/DESS/01 right 01/DESS/02 right 01/cubeQuant/01 right 01/cubeQuant/02 right 01/cubeQuant/03 right 01/cubeQuant/04 right

Reading the image data using: image_data = io.load_image_data_preprocessing(input_file_name) is ok and works

However, the next step: prep.read_dicom_stack(image_data, n_of_cores), gives me the error: RuntimeError: Exception thrown in SimpleITK WriteImage: D:\a\1\sitk-build\ITK\Modules\IO\Meta\src\itkMetaImageIO.cxx:1129: itk::ERROR: MetaImageIO(000001BD1FFB0080): File cannot be written: C:/temp/demo_knee/inputs\preprocessed\01/DESS/01_temp.mha Reason: No such file or directory

When I manually create /demo_knee/inputs/preprocessed/01/DESS, then it puts in the 2 files: 01_temp.mha and 02_temp.mha.

Similarly, I need to manually create the /demo_knee/inputs/preprocessed/01/cubeQuant, where it places 01_temp.mha, 02_temp.mha, 03_temp.mha, 04_temp.mha.

Should all of these subdirectories be created automatically?

Looking forward to using the software!

sbonaretti commented 4 years ago

Hi Matt, Since you have C:, I guess you are using Windows. In your input file, change all the / to \. Your input file should become like this:

C:\temp\demo_knee\inputs\original
01\DESS\01
right
01\DESS\02
right
01\cubeQuant\01
right
01\cubeQuant\02
right
01\cubeQuant\03
right
01\cubeQuant\04
right

Please, let me know if it works. Thanks, Serena

MatthewKoffPhD commented 4 years ago

D'oh. That was it.

Also, in an effort to move the process along, I skipped the field_correction step, but it appears that the following rescale_to_range step needs input filenames names like: '[name]_temp.mha'.

Can I manually rename the files: 01_DESS_01_orig.mha --> 01_DESS_01_temp.mha and get the rescaling and subsequent subroutines to work?

Thanks!

On Fri, Feb 14, 2020 at 5:05 AM Serena Bonaretti notifications@github.com wrote:

Hi Matt, Since you have C:, I guess you are using Windows. In your input file, change all the / to . Your input file should become like this:

C:\temp\demo_knee\inputs\original 01\DESS\01 right 01\DESS\02 right 01\cubeQuant\01 right 01\cubeQuant\02 right 01\cubeQuant\03 right 01\cubeQuant\04 right

Please, let me know if it works. Thanks, Serena

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sbonaretti/pyKNEEr/issues/4?email_source=notifications&email_token=AM6ZSZUECGAZ4A54XVMMH2TRCZUINA5CNFSM4KU7I4J2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELYIZNQ#issuecomment-586190006, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM6ZSZTKCGAZE4YAAHGIWF3RCZUINANCNFSM4KU7I4JQ .

sbonaretti commented 4 years ago

yes, that should work!