[Insight-developers] Analyze IO - patch
kent williams
norman-k-williams at uiowa.edu
Mon Feb 26 11:15:33 EST 2007
This patch will do two things: warn if a non-Analyze oriented image is read
from disk, and warn instead of throw an exception if a non-Analyze oriented
image is about to be written to disk.
I'm locked out of the repository for release right now, I'll leave it to the
gurus to decide what to do with this.
Index: itkAnalyzeImageIO.cxx
===================================================================
RCS file: /cvsroot/Insight/Insight/Code/IO/itkAnalyzeImageIO.cxx,v
retrieving revision 1.76
diff -c -r1.76 itkAnalyzeImageIO.cxx
*** itkAnalyzeImageIO.cxx 14 Feb 2007 17:51:19 -0000 1.76
--- itkAnalyzeImageIO.cxx 26 Feb 2007 16:13:18 -0000
***************
*** 959,968 ****
coord_orient =
itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_PIR;
break;
case itk::AnalyzeImageIO::ITK_ANALYZE_ORIENTATION_RIP_CORONAL:
! // fall thru
default:
coord_orient =
itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_RIP;
! itkDebugMacro( "Unknown orientation in file " << m_FileName );
}
//An error was encountered in code that depends upon the valid
coord_orientation.
typedef SpatialOrientationAdapter OrientAdapterType;
--- 959,969 ----
coord_orient =
itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_PIR;
break;
case itk::AnalyzeImageIO::ITK_ANALYZE_ORIENTATION_RIP_CORONAL:
! coord_orient =
itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_RIP;
! break;
default:
coord_orient =
itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_RIP;
! itkWarningMacro( "Unknown orientation in file " << m_FileName );
}
//An error was encountered in code that depends upon the valid
coord_orientation.
typedef SpatialOrientationAdapter OrientAdapterType;
***************
*** 1178,1184 ****
break;
default:
this->m_hdr.hist.orient=itk::AnalyzeImageIO::ITK_ANALYZE_ORIENTATION_RIP_COR
ONAL;
! itkExceptionMacro( "ERROR: Analyze 7.5 File Format Only Allows RPI,
PIR, and RIP Orientation " );
}
if(itk::ExposeMetaData<std::string>(thisDic,ITK_FileOriginator,temp))
--- 1179,1185 ----
break;
default:
this->m_hdr.hist.orient=itk::AnalyzeImageIO::ITK_ANALYZE_ORIENTATION_RIP_COR
ONAL;
! itkWarningMacro( "ERROR: Analyze 7.5 File Format Only Allows RPI,
PIR, and RIP Orientation " );
}
if(itk::ExposeMetaData<std::string>(thisDic,ITK_FileOriginator,temp))
More information about the Insight-developers
mailing list