zapaishchykova / SegmentationReview

Slicer3D extension for rating using Likert-type score Deep-learning generated segmentations, with segment editor functionality. Created to speed up the validation process done by a clinician - the dataset loads in one batch with no need to load masks and volumes separately.
MIT License
25 stars 9 forks source link

Adding files mapping feature #7

Closed vprudente closed 1 year ago

vprudente commented 1 year ago

The current implementation is constrained to .nii.gz files, and it requires the user to re-structure their files. This feature allows the user to provide a mappings.csv file, where the user specifies the paths to their images and respective masks. The extension will look for the mappings.csv file in the input_path if it finds one it uses the valid paths on it, otherwise if no mappings.csv is provided, the previous behavior is used. Note that this new feature also allows users to review their .nrrd files.

vprudente commented 1 year ago

Hi Vasco! Thanks for your pull request! QQ: with mapping file now there is a possibility of all different types of the input file extensions, I think some parts might not work as expected if the user provides some garbage files. (line 240 and 244 in the original branch) How about adding the checks for not only if the file exists, but also it has an acceptable extension (?nifty and nrrd, I'm not sure slicer.util.loadVolume works on the DICOMS)

That's a valid concern I think then the best place to do that validation would be in like 190. Where we have : if os.path.exists(img) and os.path.exists(mask): we'd also add conditions for the file extension. What do you think?