-
-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: Add DICOMOrientation class from remote module #4791
ENH: Add DICOMOrientation class from remote module #4791
Conversation
f965299
to
908dd07
Compare
908dd07
to
90a76cd
Compare
The class provides anatomical orientation based enums for describing coordinate systems. In ITK the physical coordinate systems is the same as the DICOM standard. DICOM has the following specification: If Anatomical Orientation Type (0010,2210) is absent or has a value of BIPED, the x-axis is increasing to the left hand side of the patient. The y-axis is increasing to the posterior side of the patient. The z-axis is increasing toward the head of the patient. Which describes the direction of increasing. The above coordidate system is described as "LPS" with this enumeration and corresponds to an ITK image with an identity direction cosine matrix.
This is a replacement for the OrientImageFilter, which used the DICOMOrientation enumerations and conventions for describing the patient orientation by the increasing anaomical axis.
90a76cd
to
151519c
Compare
Ensure matching byte codes between DICOM and legacy coordinate enums which have the same direction cosine interpretation. Add unambiguous CoordinateEnum duplication of the form LeftToRight. Add method to DICOMOrientationImageFilter which accepts DICOMOrientation object, which can be implicitly converted from legacy coordinate enums.
151519c
to
c11dfb7
Compare
Replace usage of SpatialOrientationAdaptor with DICOMOrientation and unambiguous FROMToTO CoordinateEnums in GE related ImageIO classes.
c11dfb7
to
4d8bf5c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good so far.
switch (this->m_NiftiImage->analyze75_orient) | ||
{ | ||
case a75_transverse_unflipped: | ||
orient = SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_RPI; | ||
orient = DICOMOrientation(DICOMOrientation::CoordinateEnum::RightToLeft, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In these long and and long-ish statements, it might make sense to using CE = DICOMOrientation::CoordinateEnum
, then use CE::RightToLeft, CE::PosteriorToAnterior, CE::InferiorToSuperior
on a single line. This applies to many places in the code, including previous commits.
One warning, Modules/IO/GE/src/itkGE5ImageIO.cxx:191:44: warning: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct GEImageHeader'; use assignment or value-initialization instead [-Wclass-memaccess] |
It is not exactly the same, 1/2 of ITK orientations are not defined in DICOM.
ITK defines "x", "y" and "z", so e.g. RAI-Code (from) LPS
exists in ITK and is not applicable to DICOM definition. |
In fact I also think that something should be done with ITK's "from" orientation codes, it seems that surprisingly many users don't understand them at all. But how should they if there is no clear documentation and, even worse, at many places there are already "to" notations. |
Co-Author: Niels Dekker <[email protected]>
Addresses: warning: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct GEImageHeader'; use assignment or value-initialization instead [-Wclass-memaccess]
@@ -1758,7 +1758,9 @@ set(ITKCommonGTests | |||
itkWeakPointerGTest.cxx | |||
itkCommonTypeTraitsGTest.cxx | |||
itkMetaDataDictionaryGTest.cxx | |||
itkSpatialOrientationAdaptorGTest.cxx) | |||
itkSpatialOrientationAdaptorGTest.cxx | |||
itkDICOMOrientionGTest.cxx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
itkDICOMOrientionGTest.cxx | |
itkDICOMOrientationGTest.cxx |
@@ -715,6 +715,7 @@ orthonormality | |||
opencl | |||
openjpeg | |||
oper | |||
osterior |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is word does not belong to the dictionary, because it should be rejected. It would be better to avoid using this word in the source code or disable spellchecking at the single place where this word is intentionally used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds like a misspelling of posterior.
* \f[ | ||
* LPS = \begin{Bmatrix} | ||
* from\ right\ to\ \textbf{L}eft \\ | ||
* from\ anterior\ towards\ \textbf{P}osterior \\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dzenanz It was added to the dictionary due to the mark up of P.
The work has evolved into another PR. I didn't expect the continued comments on this WIP, some were applied to the other PR still under development. |
So wait, this one is dead? Should we only look at #4788 ? I'm confused with all these different PRs... |
The original issue #4788 is the discussion. I have not yet directly asked for feedback on the other PR, its still approaching being finished and incorporating the feed back I have heard. There was strong opposition for using the specific "DICOM" term ( and apparently overly specific/inappropriate association), and the opposition to replacing the OritenImageFilter class, a new PR with a updated title, and an updates description seemed appropriate to help reset everyone for the updated goals. |
Should this PR be closed now? |
The class provides anatomical orientation based enums for describing coordinate systems. In ITK the physical coordinate systems is the same as the DICOM standard. DICOM has the following specification:
If Anatomical Orientation Type (0010,2210) is absent or has a value of BIPED, the x-axis is increasing to the left hand side of the patient. The y-axis is increasing to the posterior side of the patient. The z-axis is increasing toward the head of the patient.
Which describes the direction of increasing. The above coordinate system is described as "LPS" with this enumeration and corresponds to an ITK image with an identity direction cosine matrix.
See also #4788, #4788
PR Checklist
Refer to the ITK Software Guide for
further development details if necessary.