[Insight-users] VectorImage Orientation from NRRD

Daniel Betz dbetz at stud.hs-bremen.de
Sun Oct 19 21:31:48 EDT 2008


Hello Gordon,

as far as I can see are the following files affected

itkNrrdImageIO.cxx
itkNiftiImageIO.cxx
itkAnalyzeImageIO.cxx
itkGE4ImageIO.cxx
itkGE5ImageIO.cxx
itkGEAdwImageIO.cxx
itkPolygonGroupSpatialObjectXMLFile.cxx
itkSiemensVisionImageIO.cxx


With the new oriented itk::Image it is actually very easy to get
a file correctly loaded. With the commit to itkVectorImage.txx a
few ours ago I need only three "#ifndef" in itkNrrdImageIO.cxx and
my test program from the beginning of this thread passed.

<diff>
Index: Code/IO/itkNrrdImageIO.cxx
===================================================================
RCS file: /cvsroot/Insight/Insight/Code/IO/itkNrrdImageIO.cxx,v
retrieving revision 1.38
diff -u -r1.38 itkNrrdImageIO.cxx
--- Code/IO/itkNrrdImageIO.cxx  16 May 2007 19:44:55 -0000  1.38
+++ Code/IO/itkNrrdImageIO.cxx  19 Oct 2008 23:48:47 -0000
@@ -442,6 +442,7 @@
       case nrrdSpacingStatusDirection:
         if (AIR_EXISTS(spacing))
           {
+#ifndef ITK_USE_ORIENTED_IMAGE_DIRECTION
           // only set info if we have something to set
           switch (nrrd->space)
             {
@@ -464,6 +465,7 @@
               // to LPS is well-defined
               break;
             }
+#endif
           this->SetSpacing(axii, spacing);
 
           for (unsigned int saxi=0; saxi < nrrd->spaceDim; saxi++)
@@ -496,6 +498,7 @@
         {
         spaceOrigin[saxi] = nrrd->spaceOrigin[saxi];
         }
+#ifndef ITK_USE_ORIENTED_IMAGE_DIRECTION
       switch (nrrd->space)
         {
         // convert non-LPS coords into LPS coords, when we can
@@ -514,6 +517,7 @@
           // to LPS is well-defined
           break;
         }
+#endif
       for (unsigned int saxi=0; saxi < nrrd->spaceDim; saxi++)
         {
         this->SetOrigin(saxi, spaceOrigin[saxi]);
@@ -641,13 +645,16 @@
       case nrrdSpaceRightAnteriorSuperior:
       case nrrdSpaceLeftAnteriorSuperior:
       case nrrdSpaceLeftPosteriorSuperior:
+#ifndef ITK_USE_ORIENTED_IMAGE_DIRECTION
         // in all these cases we could convert
         EncapsulateMetaData<std::string>(thisDic, std::string(key),
-                                         std::string( airEnumStr(nrrdSpace, 
nrrdSpaceLeftPosteriorSuperior )));
+                                         std::string( airEnumStr(nrrdSpace,
+                                         nrrdSpaceLeftPosteriorSuperior )));
         break;
       default:
         // we're not coming from a space for which the conversion
         // to LPS is well-defined
+#endif
         EncapsulateMetaData<std::string>(thisDic, std::string(key),
                                          std::string(val));
         break;
</diff>

Regards
Daniel Betz

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://www.itk.org/pipermail/insight-users/attachments/20081020/d4456388/attachment.pgp>


More information about the Insight-users mailing list