Contains the Slicer Extension for radiology pathology fusion
- Download 3D Slicer
- Download Elastix 4.9.0.
- Clone Slicer-RadPathFusion (this repository)
- Open 3D Slicer
- Edit > Application Settings > Modules > Add
- Choose path to Slicer-RadPathFusion / RadPathFusion
- Choose Ok, Yes (Note! This will restart slicer)
A short tutorial on how to run the registration can be found here: [https://youtu.be/B2o8EMmRsHw]
- Open Slicer
- Modules > Radiology-Pathology Fusion > Parse Pathology
Example is case aaa0060 from https://wiki.cancerimagingarchive.net/display/Public/Prostate+Fused-MRI-Pathology. The case was pre-precessed and provided here to show the registration
- Open Slicer
-
at the location of TCIA_Test_Case
cd Path_To_Slicer-RadPathFusion/TCIA_Test_Case "C:\Program Files\Slicer 4.9.0-2018-07-09\Slicer.exe" ``` or * make the paths to the data absolute in all json files
- go to Modules > Radiology-Pathology Fusion > Parse Pathology
- Choose histopathology json file, e.g., the one provided as example
- In Slicer, load MRI and prostate segmentation on MRI
- Push "Load Volume" to load the histopathology images a volume
- Push "Load Mask" to see the different masks relative to the histopathology volume
- Push "Refine Volume" to do a volume reconstruction
- Push Register to Run the registraiton. !!! It will take a few minutes during which 3D Slicer will be frozen.
cd Path_To_Slicer-RadPathFusion/TCIA_Test_Case
python ..\CmdLineTools\test_run_registration.py -i registration.json
Notes:
- Script tested on Windows, proceed with care on Linux or Mac (biggest issues is associated with paths, so if it can't find the files, is because the paths in the json files don't work on our OS)
- Registration assumes slice-to-slice correspondances between radiology and pathology images. First slice in the MRI prostate segmentation corresponds to slice01 in histopathology json file. And so on so forth.
- Some MRIs have an orientation information (a rotation transform - not identity- that can be displayed using sitkImage.GetOrientation()) especially if they are acquired with an endorectal coil. If the data has that issue, you can discard the orientation using the flag "Discard Orientation" in test_run_registration on line 250. Set the flag to True by
discard_orientation = True
- Registration is a slow process, be patient!
- Registration overfits easily, often because of masks not matching well! If it happens, check the masks on both radiology and pathology images and update them to match better
- Parse Json
- add progress bar at loading
- add ability to actually load and edit loaded json (not only the volumes and masks)
- add ability to create new Json files or json entry
- Reconstruction
- Add functionality for reconstruction
- RadPathFusion
- Multi-threaded
- Dynamic instead of Hardcoded path for elastix
In order to create a 3D RGB histology volume from the histology slices one needs to have already a json file https://github.com/pimed/parse_data/blob/master/parse_digital_scans/parse_svs.py. The path to tiff files within the json need to point to existing files. The ParsePathology module will allow one to load the stack of images and correct the rotation, flipping and order in the json file.
- Open Parse Pathology module: "ModuleMenu> RAdiology-Pathology Fusion > Parse Pathology"
Arguments:
- Input json: select path to json file
- Output volume: create a volume to see the 3D volume in slices
- Output Mask: create a mask to show as mask
- Mask ID: different regions have different id, so update as needed
Actions
- Load Json: loads the json and shows it content
- Load the volume: uses the entered information to create a volume
- Load Mask: as as Load volume
- Manually number the slices from 1.. and on word before loading volume
- change the mask numbering: All same region in the stack should have the same index
- WARNING
- if there are 2 regions, eg. 0 and 1, that need to be changed, don't just write 1 instead of 0. That will internally delete the json information.
- if 0 and 1 need to be swapped: type 2 instead of 1, type 1 instead of 0, type 0 instead of 2
- Close and reopen slicer to open a new json