Skip to content

Commit

Permalink
ENH: Follow-up to SpatialOrientationEnums refactoring
Browse files Browse the repository at this point in the history
Updating comments, commented-out code and unreachable code.
The original commit is 182c018.
  • Loading branch information
dzenanz committed Feb 15, 2022
1 parent 9a94f0a commit 387cc7c
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkSpatialOrientation.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace itk
{
/** \class SpatialOrientationEnums
*
* \brief enums for SpatialOrientation
* \brief Enums for spatial orientation of images.
*
* Enums used in itk::OrientImageFilter and related classes.
*
Expand Down
4 changes: 2 additions & 2 deletions Modules/Filtering/ImageGrid/include/itkOrientImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ template <typename TInputImage, typename TOutputImage>
OrientImageFilter<TInputImage, TOutputImage>::OrientImageFilter()
: m_FlipAxes(false)
{
// Map between axis string labels and SpatialOrientation
// Map between axis string labels and spatial orientation
m_StringToCode["RIP"] = SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_RIP;
m_StringToCode["LIP"] = SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_LIP;
m_StringToCode["RSP"] = SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_RSP;
Expand Down Expand Up @@ -80,7 +80,7 @@ OrientImageFilter<TInputImage, TOutputImage>::OrientImageFilter()
m_StringToCode["AIL"] = SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_AIL;
m_StringToCode["ASL"] = SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_ASL;

// Map between axis string labels and SpatialOrientation
// Map between spatial orientation and axis string labels
m_CodeToString[SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_RIP] = "RIP";
m_CodeToString[SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_LIP] = "LIP";
m_CodeToString[SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_RSP] = "RSP";
Expand Down
21 changes: 10 additions & 11 deletions Modules/IO/GE/src/itkGE4ImageIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -159,35 +159,34 @@ GE4ImageIO::ReadHeader(const char * FileNameToRead)
if (strstr(tmpStr, "CORONAL") != nullptr)
{
// hdr->imagePlane =
// itk::SpatialOrientation::ITK_ANALYZE_ORIENTATION_IRP_CORONAL;
// hdr->origin = itk::SpatialOrientation::ITK_ORIGIN_SRP; // was SLA in the
// brains2 filter.
// itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_ANALYZE_ORIENTATION_IRP_CORONAL;
// hdr->origin = itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_ORIGIN_SRP;
// hdr->origin was SLA in the brains2 filter.
hdr->coordinateOrientation =
itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_RSP;
}
else if (strstr(tmpStr, "SAGITTAL") != nullptr)
{
// hdr->imagePlane =
// itk::SpatialOrientation::ITK_ANALYZE_ORIENTATION_IRP_SAGITTAL;
// hdr->origin = itk::SpatialOrientation::ITK_ORIGIN_SRA; //was SLP in the
// brains2 filter.
// itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_ANALYZE_ORIENTATION_IRP_SAGITTAL;
// hdr->origin = itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_ORIGIN_SRA;
// hdr->origin was SLP in the brains2 filter.
hdr->coordinateOrientation =
itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_AIR;
}
else if (strstr(tmpStr, "AXIAL") != nullptr)
{
// hdr->imagePlane =
// itk::SpatialOrientation::ITK_ANALYZE_ORIENTATION_IRP_TRANSVERSE;
// hdr->origin = itk::SpatialOrientation::ITK_ORIGIN_SRA; //was SLP in the
// brains2 filter.
// itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_ANALYZE_ORIENTATION_IRP_TRANSVERSE;
// hdr->origin = itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_ORIGIN_SRA; // was SLP
hdr->coordinateOrientation =
itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_RAI;
}
else
{
// hdr->imagePlane =
// itk::SpatialOrientation::ITK_ANALYZE_ORIENTATION_IRP_CORONAL;
// hdr->origin = itk::SpatialOrientation::ITK_ORIGIN_SRP; // was SLA
// itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_ANALYZE_ORIENTATION_IRP_CORONAL;
// hdr->origin = itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_ORIGIN_SRP; // was SLA
hdr->coordinateOrientation =
itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_RSP;
}
Expand Down
12 changes: 6 additions & 6 deletions Modules/IO/GE/src/itkGEAdwImageIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -172,22 +172,22 @@ GEAdwImageIO::ReadHeader(const char * FileNameToRead)
break;
case GE_SAGITTAL:
// hdr->imagePlane =
// itk::SpatialOrientation::ITK_ANALYZE_ORIENTATION_IRP_SAGITTAL;
// hdr->origin = itk::SpatialOrientation::ITK_ORIGIN_SLA;
// itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_ANALYZE_ORIENTATION_IRP_SAGITTAL;
// hdr->origin = itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_ORIGIN_SLA;
hdr->coordinateOrientation =
itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_AIR;
break;
case GE_AXIAL:
// hdr->imagePlane =
// itk::SpatialOrientation::ITK_ANALYZE_ORIENTATION_IRP_TRANSVERSE;
// hdr->origin = itk::SpatialOrientation::ITK_ORIGIN_SLA;
// itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_ANALYZE_ORIENTATION_IRP_TRANSVERSE;
// hdr->origin = itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_ORIGIN_SLA;
hdr->coordinateOrientation =
itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_RAI;
break;
default:
// hdr->imagePlane =
// itk::SpatialOrientation::ITK_ANALYZE_ORIENTATION_IRP_CORONAL;
// hdr->origin = itk::SpatialOrientation::ITK_ORIGIN_SLA;
// itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_ANALYZE_ORIENTATION_IRP_CORONAL;
// hdr->origin = itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_ORIGIN_SLA;
hdr->coordinateOrientation =
itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_RSP;
break;
Expand Down
3 changes: 2 additions & 1 deletion Modules/IO/NIFTI/test/itkNiftiImageIOTest4.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ itkNiftiImageIOTest4(int argc, char * argv[])
}

#else
dir = itk::SpatialOrientationAdapter().ToDirectionCosines(itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_PLI);
dir = itk::SpatialOrientationAdapter().ToDirectionCosines(
itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_PLI);
#endif
test4Image->SetDirection(dir);
std::string fname("directionsTest.nii.gz");
Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/NIFTI/test/itkNiftiReadAnalyzeTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const unsigned char LittleEndian_img[] = {
0x00, 0x00, 0xe0, 0x42, 0x00, 0x00, 0xe0, 0x42, 0x00, 0x00, 0xe0, 0x42,
};

// Map between axis string labels and SpatialOrientation
// Map between axis string labels and spatial orientation
std::map<itk::SpatialOrientationEnums::ValidCoordinateOrientations, std::string> codeToString = {
{ itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_RIP, "RIP" },
{ itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_LIP, "LIP" },
Expand Down
16 changes: 8 additions & 8 deletions Modules/IO/Siemens/src/itkSiemensVisionImageIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,14 @@ SiemensVisionImageIO::ReadHeader(const char * FileNameToRead)
if (strcmp(tmpStr2, "Sag") == 0)
{
// hdr->imagePlane =
// itk::SpatialOrientation::ITK_ANALYZE_ORIENTATION_IRP_SAGITTAL;
// itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_ANALYZE_ORIENTATION_IRP_SAGITTAL;
hdr->coordinateOrientation =
itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_AIR;
}
else
{
// hdr->imagePlane =
// itk::SpatialOrientation::ITK_ANALYZE_ORIENTATION_IRP_TRANSVERSE;
// itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_ANALYZE_ORIENTATION_IRP_TRANSVERSE;
hdr->coordinateOrientation =
itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_RAI;
}
Expand All @@ -249,7 +249,7 @@ SiemensVisionImageIO::ReadHeader(const char * FileNameToRead)
if (text_angle_len.empty() || itk::Math::abs(std::stod(text_angle_len)) <= 45.0)
{
// hdr->imagePlane =
// itk::SpatialOrientation::ITK_ANALYZE_ORIENTATION_IRP_SAGITTAL;
// itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_ANALYZE_ORIENTATION_IRP_SAGITTAL;
hdr->coordinateOrientation =
itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_AIR;
}
Expand All @@ -258,14 +258,14 @@ SiemensVisionImageIO::ReadHeader(const char * FileNameToRead)
if (strcmp(tmpStr2, "Cor") == 0)
{
// hdr->imagePlane =
// itk::SpatialOrientation::ITK_ANALYZE_ORIENTATION_IRP_CORONAL;
// itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_ANALYZE_ORIENTATION_IRP_CORONAL;
hdr->coordinateOrientation =
itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_RSP;
}
else
{
// hdr->imagePlane =
// itk::SpatialOrientation::ITK_ANALYZE_ORIENTATION_IRP_TRANSVERSE;
// itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_ANALYZE_ORIENTATION_IRP_TRANSVERSE;
hdr->coordinateOrientation =
itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_RAI;
}
Expand All @@ -276,7 +276,7 @@ SiemensVisionImageIO::ReadHeader(const char * FileNameToRead)
if (text_angle_len.empty() || itk::Math::abs(std::stod(text_angle_len)) <= 45.0)
{
// hdr->imagePlane =
// itk::SpatialOrientation::ITK_ANALYZE_ORIENTATION_IRP_TRANSVERSE;
// itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_ANALYZE_ORIENTATION_IRP_TRANSVERSE;
hdr->coordinateOrientation =
itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_RAI;
}
Expand All @@ -285,14 +285,14 @@ SiemensVisionImageIO::ReadHeader(const char * FileNameToRead)
if (strcmp(tmpStr2, "Cor") == 0)
{
// hdr->imagePlane =
// itk::SpatialOrientation::ITK_ANALYZE_ORIENTATION_IRP_CORONAL;
// itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_ANALYZE_ORIENTATION_IRP_CORONAL;
hdr->coordinateOrientation =
itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_RSP;
}
else
{
// hdr->imagePlane =
// itk::SpatialOrientation::ITK_ANALYZE_ORIENTATION_IRP_SAGITTAL;
// itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_ANALYZE_ORIENTATION_IRP_SAGITTAL;
hdr->coordinateOrientation =
itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_AIR;
}
Expand Down

0 comments on commit 387cc7c

Please sign in to comment.