3881 using sform/qform code 1 for the writers#3882
Conversation
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
|
/build |
Signed-off-by: Wenqi Li <[email protected]>
|
(also CC'ing @hjmjohnson in case there are more comments) |
|
/build |
1 similar comment
|
/build |
|
I'm not sure hard-coding these values is the right process, either we should be setting them to whatever is appropriate or inheriting whatever the original values were if present in metadata. ITK hard codes it but that's not necessarily the best thing to do, nor is inconsistent values in the header a problem so long as they are set correctly. Setting both these values to 1 selects transform method 3 (https://www.nitrc.org/docman/view.php/26/204/TheNIfTI, pages 12 and 13). If an input nifti uses another method then the header of the output image will be different but both ITK and our code will do this consistent with one another. If we did hard code the values as such we have to fill in the |
this part is done by the
|
|
I will need some time to make a more detailed review. I have found that all options are a catch-22 with nifti files. The qform is lossy with respect to the dicom standard, and often results in numerical precision problems when dealing with physical space. The sform has enough precision to be lossless with respect to the dicom standard, but does not necessarily impose that the representation has orthogonal axis. To further complicate matters, many external tools have developed different protocols and interpretations of when/how to use each of the storage format. Even ITK's behavior has evolved over time trying to adapt to the environment. The most recent changes opted to try to be less lossy during data conversion so that physical space can be reliably represented with respect to the original dicom data. This change occurred when nifti binary masks were not reported in the same physical space as the dicom originating space. The problem turned out to be small errors in translation to/from qform representations. |
|
/build |
1 similar comment
|
/build |
|
@hjmjohnson did you take a second look here? |
Yes. I don't think there is a clear solution from ITK's standpoint. ITK defaults to writing the sform content because it most closely matches the internal ITK storage representation, and it provides the least lossy path from DICOM representations of physical2index space mapping. |
|
So, approve PR? |
hjmjohnson
left a comment
There was a problem hiding this comment.
I think setting the sform and qform codes to 1 is the safest way.
Signed-off-by: Wenqi Li <[email protected]>
|
/build |
Signed-off-by: Wenqi Li <[email protected]>
|
/build |
Signed-off-by: Wenqi Li <[email protected]>
|
/build |
Fixes #3881 Follow-up of Project-MONAI/tutorials#481 ### Description following https://github.com/InsightSoftwareConsortium/ITK/blob/15aa8d58a01a1279e1fafa2214c82edd80b17e92/Modules/IO/NIFTI/src/itkNiftiImageIO.cxx#L2174-L2176 ### Status **Ready** ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [x] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: Wenqi Li <[email protected]> Signed-off-by: KumoLiu <[email protected]>
Fixes Project-MONAI#3881 Follow-up of Project-MONAI/tutorials#481 ### Description following https://github.com/InsightSoftwareConsortium/ITK/blob/15aa8d58a01a1279e1fafa2214c82edd80b17e92/Modules/IO/NIFTI/src/itkNiftiImageIO.cxx#L2174-L2176 ### Status **Ready** ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [x] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: Wenqi Li <[email protected]> Signed-off-by: Yiheng Wang <[email protected]>
Fixes Project-MONAI#3881 Follow-up of Project-MONAI/tutorials#481 ### Description following https://github.com/InsightSoftwareConsortium/ITK/blob/15aa8d58a01a1279e1fafa2214c82edd80b17e92/Modules/IO/NIFTI/src/itkNiftiImageIO.cxx#L2174-L2176 ### Status **Ready** ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [x] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: Wenqi Li <[email protected]> Signed-off-by: Yiheng Wang <[email protected]>
Fixes #3881
Follow-up of Project-MONAI/tutorials#481
Description
following https://github.com/InsightSoftwareConsortium/ITK/blob/15aa8d58a01a1279e1fafa2214c82edd80b17e92/Modules/IO/NIFTI/src/itkNiftiImageIO.cxx#L2174-L2176
Status
Ready
Types of changes
./runtests.sh -f -u --net --coverage../runtests.sh --quick --unittests --disttests.make htmlcommand in thedocs/folder.