You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
manifest-gJIZVVFt6412408718812805737\
PROSTATE-DIAGNOSIS\
ProstateDx-01-0001\
09-23-2008-NA-MRI PROSTATE WITH AND WITHOUT CONTRAST-00237\
501.000000-T2WTSEAX-40778
Steps to reproduce the disagreement
Process dicom image
No preprocessing of the dataset is required, the input is a DICOM file with the following command:
python -m monai.bundle run --config_file configs/inference_dicom.json
The config file is referred from 'Project-MONAI/modelzoo/models/prostate_mri_anatomy/configs/inference.json' with the following changes to modify its path:
From the input that we given, we can find affine matrix with the following:
The difference:
Process dicom image
Process nifti image
Truncate the floating point
I added this line separately to both Monai and dicom2nifti:
affine = orientation_ras_lps(affine)
After I truncated these individual values to five decimal places, we can achieve the same affine matrix and the same segmentation results.
Process dicom image
Process nifti image
It is obvious that this element, with its precise floating-point value plays a role.
Given this result, I don't know which is correct, so I am sharing them here to seek feedback.
The text was updated successfully, but these errors were encountered:
Environment
OS:
Linux
Python version:
3.8.18
Monai version:
1.3.0
dicom2nifti version:
2.4.8
Dataset:
https://wiki.cancerimagingarchive.net/display/Public/PROSTATE-DIAGNOSIS
Test data path:
Steps to reproduce the disagreement
Process dicom image
No preprocessing of the dataset is required, the input is a DICOM file with the following command:
The config file is referred from 'Project-MONAI/modelzoo/models/prostate_mri_anatomy/configs/inference.json' with the following changes to modify its path:
Process nifti image
Step 1: Convert dicom to nifti with the following command:
Step 2: Get segmentation results from Monai model:
The config file is referred from the same source as Monai with the following changes to modify its path:
Expected result
The segmentation results should be the same.
My investigation
As you can see from the pictures below , two segmentation results are different:
After digging into the code a little bit, I find that the affine matrix should play the important role in making this difference.
Finding the affine matrix
Process dicom image
The affine matrix from 'monai/data/image_reader.py' is defined with:
From the input that we given, we can find affine matrix with the following:
Process nifti image
The affine matrix from 'dicom2nifti/common.py' is defined with:
From the input that we given, we can find affine matrix with the following:
The difference:
Truncate the floating point
I added this line separately to both Monai and dicom2nifti:
After I truncated these individual values to five decimal places, we can achieve the same affine matrix and the same segmentation results.
It is obvious that this element, with its precise floating-point value plays a role.
Given this result, I don't know which is correct, so I am sharing them here to seek feedback.
The text was updated successfully, but these errors were encountered: