Git Product home page Git Product logo

Comments (11)

rcuocolo avatar rcuocolo commented on August 23, 2024 1

I have updated the repository and readme with the masks for the NIFTI files. These provide a valid workaround for this issue (after converting the original DICOMs to NIFTI files using dcm2niix), and could be useful to fix the issue in and of itself.

from prostatex_masks.

rcuocolo avatar rcuocolo commented on August 23, 2024

Thank you for letting me know. I will look into it as soon as possible.

from prostatex_masks.

rcuocolo avatar rcuocolo commented on August 23, 2024

Sorry for the wait. The mask of finding3 for the ADC map in patient 0142 should now be fixed. I can confirm the issue of the "flipped" arrays for ADC as well, if you have already scripted a fix, can I ask you to perform a pull request and upload the corrected files (including the new mask for patient 0142). This would be of great help in speeding up the fix.

from prostatex_masks.

enliden1 avatar enliden1 commented on August 23, 2024

Thank you for the confirmation. I'll upload my project in a couple of months, and could perform a pull request then. For now i've only adjusted the bounding box, not the mask.

from prostatex_masks.

rcuocolo avatar rcuocolo commented on August 23, 2024

The issues with ADC maps are probably due to the process used to annotate lesions. DICOM files were first converted to the NII format using dcm2niix, segmented on ITKSNAP, then flipped back to the DICOM geometry using nibabel and numpy (flipping along the Y axis if I remember correctly).
At visual inspection on ITKSNAP these ROIs appear to be correctly positioned, but at closer inspection the issue with array orientation is present.
As a stopgap solution, I will upload the NII masks (not flipped) as they are surely correctly matched with the PROSTATEx files if converted to NII format using dcm2niix. If you could provide correctly reoriented masks with a future pull request, it would be greatly appreciated as currently I am pretty swamped and don't have much time to work on this issue actively.

from prostatex_masks.

wassname avatar wassname commented on August 23, 2024

I believe that you can reverse what dcm2niix did with

  • mask.transpose((1, 0, 2))[::-1, :, ::-1]
    • swapping x and y
    • reversing order on x (was y) and z

Here's an image of proof of concept with the image that enliden1 mentioned:

image

code

P.S. for people attempting to use dcm2nii, the exact command I used was:

dcm2niix -z y -v y -a y -o nii -f %i_%s ./dicom/train/downloads/PROSTATEx/, this gives unique names and matches the PROSTATEx_masks for nii files.

from prostatex_masks.

rcuocolo avatar rcuocolo commented on August 23, 2024

Thank you for the contribution. I was flipping only one axis. I will test and implement this ASAP and upload the fixed files. I was waiting for the time to fix this issue prior to submitting the dataset to TCIA.

from prostatex_masks.

rcuocolo avatar rcuocolo commented on August 23, 2024

Unfortunately the issue is more complex. The proposed solution causes the mask not to correspond to the lesion anymore. Currently, the only way to ensure lesions are correctly segmented is to convert the DICOM files to NIFTI using dcm2niix (there are the options used by me: dcm2niix -d 9 -z y -9). The issue also affects T2 files (lesion annotations are not correctly placed on DICOM files).
On the bright side, I was able to understand from where the issue arose. In ITKSNAP the DICOM volume is flipped and matches the masks included in the repository. This behavior is not consistent with 3DSlicer, which shows the ROI as misplaced (in all cases, the original annotation, my original transposition to DICOM space, and the fix suggested by @wassname). I am unsure of what ITKSNAP does differently when displaying DICOM images, but this is the reason the issue was undetected previously (I usually employ ITKSNAP rather than 3DSlicer for quick visual check due to ease of loading files). I think it will be better to remove DICOM masks altogether for now and only leave NIFTI masks (which work consistently).
I do not want to rehost the PROSTATEx dataset in NIFTI format here, so each user will have to convert the images to this format independently.
If there are any further suggestions on how to solve the issue, they are very welcome.

from prostatex_masks.

rcuocolo avatar rcuocolo commented on August 23, 2024

For @wassname, your image overlay seems indeed correct, but I was unable to save it and not have the issue present in 3DSlicer (probably due to using the affine from the unflipped mask to save). Could you test your approach with lesion 1 from the first patient and upload the files? It is the case I am using for troubleshooting right now.

from prostatex_masks.

wassname avatar wassname commented on August 23, 2024

Sure I will have a look today

from prostatex_masks.

wassname avatar wassname commented on August 23, 2024

Here we are, this gist has links to my files, and example code to load them.

I also tried using your dcm2niix command dcm2niix -d 9 -z y -9 and it still works the same.

from prostatex_masks.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.