ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkSpatialOrientation.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 /*=========================================================================
00019  *
00020  *  Portions of this file are subject to the VTK Toolkit Version 3 copyright.
00021  *
00022  *  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00023  *
00024  *  For complete copyright, license and disclaimer of warranty information
00025  *  please refer to the NOTICE file at the top of the ITK source tree.
00026  *
00027  *=========================================================================*/
00028 #ifndef __itkSpatialOrientation_h
00029 #define __itkSpatialOrientation_h
00030 
00031 namespace itk
00032 {
00033 namespace SpatialOrientation
00034 {
00035 //  Coordinate orientation codes have a place-value organization such that
00036 //  an ImageDimension-al sequence of subcodes says both which varies fastest
00037 //  through which varies slowest, but also which end of the frame of
00038 //  reference
00039 //  is considered zero for each of the coordinates.  For example, 'RIP'
00040 //  means
00041 //  Right to Left varies fastest, then Inferior to Superior, and Posterior
00042 //  to
00043 //  Anterior varies the slowest.
00044 typedef enum {
00045   ITK_COORDINATE_UNKNOWN = 0,
00046   ITK_COORDINATE_Right = 2,
00047   ITK_COORDINATE_Left = 3,
00048   ITK_COORDINATE_Posterior = 4, //back
00049   ITK_COORDINATE_Anterior = 5,  //front
00050   ITK_COORDINATE_Inferior = 8,  //below
00051   ITK_COORDINATE_Superior = 9   //above
00052                                 // ITK_COORDINATE_Historical=16,
00053                                 // ITK_COORDINATE_Future=17
00054   } CoordinateTerms;
00055 
00056 typedef enum {
00057   // These code place values have to be far enough apart to
00058   // separate the CoordinateTerms above.
00059   // However, if we added History/Future direction in time,
00060   // we would need at least 5 bits per.
00061   ITK_COORDINATE_PrimaryMinor = 0,
00062   ITK_COORDINATE_SecondaryMinor = 8,
00063   ITK_COORDINATE_TertiaryMinor = 16
00064                                  // Majorness is in terms of rank-minor because
00065                                  // a
00066                                  // fourth dimension, time, would be even More
00067                                  // major than the
00068                                  // PrimaryMajor==TertiaryMinor.
00069                                  // ITK_COORDINATE_QuaternaryMinor=24
00070   } CoordinateMajornessTerms;
00071 // Adding time IN GENERAL would make these 8 x 6 = 48 triples into 16
00072 // x 24 = 384 4-tuples.
00073 // A general fourth dimension would need a unique pair of letters to
00074 // add to the code;
00075 // Maybe use H and F, from History to Future? Maybe use 48 x 2 with
00076 // time ALWAYS highest
00077 // order, or 48 x 2 x 2, with 3-space always highest or lowest order?
00078 // Multispectra might be
00079 // co-registered and pieced together.... PD-T2 interleaving of
00080 // slices is handled with choosing
00081 // which spectrum to load via the prototypical file name.
00082 typedef enum {
00083   ITK_COORDINATE_ORIENTATION_INVALID = ITK_COORDINATE_UNKNOWN,
00084   ITK_COORDINATE_ORIENTATION_RIP = ( ITK_COORDINATE_Right
00085                                      << ITK_COORDINATE_PrimaryMinor )
00086                                    + ( ITK_COORDINATE_Inferior << ITK_COORDINATE_SecondaryMinor )
00087                                    + ( ITK_COORDINATE_Posterior << ITK_COORDINATE_TertiaryMinor ),
00088   ITK_COORDINATE_ORIENTATION_LIP = ( ITK_COORDINATE_Left
00089                                      << ITK_COORDINATE_PrimaryMinor )
00090                                    + ( ITK_COORDINATE_Inferior << ITK_COORDINATE_SecondaryMinor )
00091                                    + ( ITK_COORDINATE_Posterior << ITK_COORDINATE_TertiaryMinor ),
00092   ITK_COORDINATE_ORIENTATION_RSP = ( ITK_COORDINATE_Right
00093                                      << ITK_COORDINATE_PrimaryMinor )
00094                                    + ( ITK_COORDINATE_Superior << ITK_COORDINATE_SecondaryMinor )
00095                                    + ( ITK_COORDINATE_Posterior << ITK_COORDINATE_TertiaryMinor ),
00096   ITK_COORDINATE_ORIENTATION_LSP = ( ITK_COORDINATE_Left
00097                                      << ITK_COORDINATE_PrimaryMinor )
00098                                    + ( ITK_COORDINATE_Superior << ITK_COORDINATE_SecondaryMinor )
00099                                    + ( ITK_COORDINATE_Posterior << ITK_COORDINATE_TertiaryMinor ),
00100   ITK_COORDINATE_ORIENTATION_RIA = ( ITK_COORDINATE_Right
00101                                      << ITK_COORDINATE_PrimaryMinor )
00102                                    + ( ITK_COORDINATE_Inferior << ITK_COORDINATE_SecondaryMinor )
00103                                    + ( ITK_COORDINATE_Anterior << ITK_COORDINATE_TertiaryMinor ),
00104   ITK_COORDINATE_ORIENTATION_LIA = ( ITK_COORDINATE_Left
00105                                      << ITK_COORDINATE_PrimaryMinor )
00106                                    + ( ITK_COORDINATE_Inferior << ITK_COORDINATE_SecondaryMinor )
00107                                    + ( ITK_COORDINATE_Anterior << ITK_COORDINATE_TertiaryMinor ),
00108   ITK_COORDINATE_ORIENTATION_RSA = ( ITK_COORDINATE_Right
00109                                      << ITK_COORDINATE_PrimaryMinor )
00110                                    + ( ITK_COORDINATE_Superior << ITK_COORDINATE_SecondaryMinor )
00111                                    + ( ITK_COORDINATE_Anterior << ITK_COORDINATE_TertiaryMinor ),
00112   ITK_COORDINATE_ORIENTATION_LSA = ( ITK_COORDINATE_Left
00113                                      << ITK_COORDINATE_PrimaryMinor )
00114                                    + ( ITK_COORDINATE_Superior << ITK_COORDINATE_SecondaryMinor )
00115                                    + ( ITK_COORDINATE_Anterior << ITK_COORDINATE_TertiaryMinor ),
00116 
00117   ITK_COORDINATE_ORIENTATION_IRP = ( ITK_COORDINATE_Inferior
00118                                      << ITK_COORDINATE_PrimaryMinor )
00119                                    + ( ITK_COORDINATE_Right << ITK_COORDINATE_SecondaryMinor )
00120                                    + ( ITK_COORDINATE_Posterior << ITK_COORDINATE_TertiaryMinor ),
00121   ITK_COORDINATE_ORIENTATION_ILP = ( ITK_COORDINATE_Inferior
00122                                      << ITK_COORDINATE_PrimaryMinor )
00123                                    + ( ITK_COORDINATE_Left << ITK_COORDINATE_SecondaryMinor )
00124                                    + ( ITK_COORDINATE_Posterior << ITK_COORDINATE_TertiaryMinor ),
00125   ITK_COORDINATE_ORIENTATION_SRP = ( ITK_COORDINATE_Superior
00126                                      << ITK_COORDINATE_PrimaryMinor )
00127                                    + ( ITK_COORDINATE_Right << ITK_COORDINATE_SecondaryMinor )
00128                                    + ( ITK_COORDINATE_Posterior << ITK_COORDINATE_TertiaryMinor ),
00129   ITK_COORDINATE_ORIENTATION_SLP = ( ITK_COORDINATE_Superior
00130                                      << ITK_COORDINATE_PrimaryMinor )
00131                                    + ( ITK_COORDINATE_Left << ITK_COORDINATE_SecondaryMinor )
00132                                    + ( ITK_COORDINATE_Posterior << ITK_COORDINATE_TertiaryMinor ),
00133   ITK_COORDINATE_ORIENTATION_IRA = ( ITK_COORDINATE_Inferior
00134                                      << ITK_COORDINATE_PrimaryMinor )
00135                                    + ( ITK_COORDINATE_Right << ITK_COORDINATE_SecondaryMinor )
00136                                    + ( ITK_COORDINATE_Anterior << ITK_COORDINATE_TertiaryMinor ),
00137   ITK_COORDINATE_ORIENTATION_ILA = ( ITK_COORDINATE_Inferior
00138                                      << ITK_COORDINATE_PrimaryMinor )
00139                                    + ( ITK_COORDINATE_Left << ITK_COORDINATE_SecondaryMinor )
00140                                    + ( ITK_COORDINATE_Anterior << ITK_COORDINATE_TertiaryMinor ),
00141   ITK_COORDINATE_ORIENTATION_SRA = ( ITK_COORDINATE_Superior
00142                                      << ITK_COORDINATE_PrimaryMinor )
00143                                    + ( ITK_COORDINATE_Right << ITK_COORDINATE_SecondaryMinor )
00144                                    + ( ITK_COORDINATE_Anterior << ITK_COORDINATE_TertiaryMinor ),
00145   ITK_COORDINATE_ORIENTATION_SLA = ( ITK_COORDINATE_Superior
00146                                      << ITK_COORDINATE_PrimaryMinor )
00147                                    + ( ITK_COORDINATE_Left << ITK_COORDINATE_SecondaryMinor )
00148                                    + ( ITK_COORDINATE_Anterior << ITK_COORDINATE_TertiaryMinor ),
00149 
00150   ITK_COORDINATE_ORIENTATION_RPI = ( ITK_COORDINATE_Right
00151                                      << ITK_COORDINATE_PrimaryMinor )
00152                                    + ( ITK_COORDINATE_Posterior << ITK_COORDINATE_SecondaryMinor )
00153                                    + ( ITK_COORDINATE_Inferior << ITK_COORDINATE_TertiaryMinor ),
00154   ITK_COORDINATE_ORIENTATION_LPI = ( ITK_COORDINATE_Left
00155                                      << ITK_COORDINATE_PrimaryMinor )
00156                                    + ( ITK_COORDINATE_Posterior << ITK_COORDINATE_SecondaryMinor )
00157                                    + ( ITK_COORDINATE_Inferior << ITK_COORDINATE_TertiaryMinor ),
00158   ITK_COORDINATE_ORIENTATION_RAI = ( ITK_COORDINATE_Right
00159                                      << ITK_COORDINATE_PrimaryMinor )
00160                                    + ( ITK_COORDINATE_Anterior << ITK_COORDINATE_SecondaryMinor )
00161                                    + ( ITK_COORDINATE_Inferior << ITK_COORDINATE_TertiaryMinor ),
00162   ITK_COORDINATE_ORIENTATION_LAI = ( ITK_COORDINATE_Left
00163                                      << ITK_COORDINATE_PrimaryMinor )
00164                                    + ( ITK_COORDINATE_Anterior << ITK_COORDINATE_SecondaryMinor )
00165                                    + ( ITK_COORDINATE_Inferior << ITK_COORDINATE_TertiaryMinor ),
00166   ITK_COORDINATE_ORIENTATION_RPS = ( ITK_COORDINATE_Right
00167                                      << ITK_COORDINATE_PrimaryMinor )
00168                                    + ( ITK_COORDINATE_Posterior << ITK_COORDINATE_SecondaryMinor )
00169                                    + ( ITK_COORDINATE_Superior << ITK_COORDINATE_TertiaryMinor ),
00170   ITK_COORDINATE_ORIENTATION_LPS = ( ITK_COORDINATE_Left
00171                                      << ITK_COORDINATE_PrimaryMinor )
00172                                    + ( ITK_COORDINATE_Posterior << ITK_COORDINATE_SecondaryMinor )
00173                                    + ( ITK_COORDINATE_Superior << ITK_COORDINATE_TertiaryMinor ),
00174   ITK_COORDINATE_ORIENTATION_RAS = ( ITK_COORDINATE_Right
00175                                      << ITK_COORDINATE_PrimaryMinor )
00176                                    + ( ITK_COORDINATE_Anterior << ITK_COORDINATE_SecondaryMinor )
00177                                    + ( ITK_COORDINATE_Superior << ITK_COORDINATE_TertiaryMinor ),
00178   ITK_COORDINATE_ORIENTATION_LAS = ( ITK_COORDINATE_Left
00179                                      << ITK_COORDINATE_PrimaryMinor )
00180                                    + ( ITK_COORDINATE_Anterior << ITK_COORDINATE_SecondaryMinor )
00181                                    + ( ITK_COORDINATE_Superior << ITK_COORDINATE_TertiaryMinor ),
00182 
00183   ITK_COORDINATE_ORIENTATION_PRI = ( ITK_COORDINATE_Posterior
00184                                      << ITK_COORDINATE_PrimaryMinor )
00185                                    + ( ITK_COORDINATE_Right << ITK_COORDINATE_SecondaryMinor )
00186                                    + ( ITK_COORDINATE_Inferior << ITK_COORDINATE_TertiaryMinor ),
00187   ITK_COORDINATE_ORIENTATION_PLI = ( ITK_COORDINATE_Posterior
00188                                      << ITK_COORDINATE_PrimaryMinor )
00189                                    + ( ITK_COORDINATE_Left << ITK_COORDINATE_SecondaryMinor )
00190                                    + ( ITK_COORDINATE_Inferior << ITK_COORDINATE_TertiaryMinor ),
00191   ITK_COORDINATE_ORIENTATION_ARI = ( ITK_COORDINATE_Anterior
00192                                      << ITK_COORDINATE_PrimaryMinor )
00193                                    + ( ITK_COORDINATE_Right << ITK_COORDINATE_SecondaryMinor )
00194                                    + ( ITK_COORDINATE_Inferior << ITK_COORDINATE_TertiaryMinor ),
00195   ITK_COORDINATE_ORIENTATION_ALI = ( ITK_COORDINATE_Anterior
00196                                      << ITK_COORDINATE_PrimaryMinor )
00197                                    + ( ITK_COORDINATE_Left << ITK_COORDINATE_SecondaryMinor )
00198                                    + ( ITK_COORDINATE_Inferior << ITK_COORDINATE_TertiaryMinor ),
00199   ITK_COORDINATE_ORIENTATION_PRS = ( ITK_COORDINATE_Posterior
00200                                      << ITK_COORDINATE_PrimaryMinor )
00201                                    + ( ITK_COORDINATE_Right << ITK_COORDINATE_SecondaryMinor )
00202                                    + ( ITK_COORDINATE_Superior << ITK_COORDINATE_TertiaryMinor ),
00203   ITK_COORDINATE_ORIENTATION_PLS = ( ITK_COORDINATE_Posterior
00204                                      << ITK_COORDINATE_PrimaryMinor )
00205                                    + ( ITK_COORDINATE_Left << ITK_COORDINATE_SecondaryMinor )
00206                                    + ( ITK_COORDINATE_Superior << ITK_COORDINATE_TertiaryMinor ),
00207   ITK_COORDINATE_ORIENTATION_ARS = ( ITK_COORDINATE_Anterior
00208                                      << ITK_COORDINATE_PrimaryMinor )
00209                                    + ( ITK_COORDINATE_Right << ITK_COORDINATE_SecondaryMinor )
00210                                    + ( ITK_COORDINATE_Superior << ITK_COORDINATE_TertiaryMinor ),
00211   ITK_COORDINATE_ORIENTATION_ALS = ( ITK_COORDINATE_Anterior
00212                                      << ITK_COORDINATE_PrimaryMinor )
00213                                    + ( ITK_COORDINATE_Left << ITK_COORDINATE_SecondaryMinor )
00214                                    + ( ITK_COORDINATE_Superior << ITK_COORDINATE_TertiaryMinor ),
00215 
00216   ITK_COORDINATE_ORIENTATION_IPR = ( ITK_COORDINATE_Inferior
00217                                      << ITK_COORDINATE_PrimaryMinor )
00218                                    + ( ITK_COORDINATE_Posterior << ITK_COORDINATE_SecondaryMinor )
00219                                    + ( ITK_COORDINATE_Right << ITK_COORDINATE_TertiaryMinor ),
00220   ITK_COORDINATE_ORIENTATION_SPR = ( ITK_COORDINATE_Superior
00221                                      << ITK_COORDINATE_PrimaryMinor )
00222                                    + ( ITK_COORDINATE_Posterior << ITK_COORDINATE_SecondaryMinor )
00223                                    + ( ITK_COORDINATE_Right << ITK_COORDINATE_TertiaryMinor ),
00224   ITK_COORDINATE_ORIENTATION_IAR = ( ITK_COORDINATE_Inferior
00225                                      << ITK_COORDINATE_PrimaryMinor )
00226                                    + ( ITK_COORDINATE_Anterior << ITK_COORDINATE_SecondaryMinor )
00227                                    + ( ITK_COORDINATE_Right << ITK_COORDINATE_TertiaryMinor ),
00228   ITK_COORDINATE_ORIENTATION_SAR = ( ITK_COORDINATE_Superior
00229                                      << ITK_COORDINATE_PrimaryMinor )
00230                                    + ( ITK_COORDINATE_Anterior << ITK_COORDINATE_SecondaryMinor )
00231                                    + ( ITK_COORDINATE_Right << ITK_COORDINATE_TertiaryMinor ),
00232   ITK_COORDINATE_ORIENTATION_IPL = ( ITK_COORDINATE_Inferior
00233                                      << ITK_COORDINATE_PrimaryMinor )
00234                                    + ( ITK_COORDINATE_Posterior << ITK_COORDINATE_SecondaryMinor )
00235                                    + ( ITK_COORDINATE_Left << ITK_COORDINATE_TertiaryMinor ),
00236   ITK_COORDINATE_ORIENTATION_SPL = ( ITK_COORDINATE_Superior
00237                                      << ITK_COORDINATE_PrimaryMinor )
00238                                    + ( ITK_COORDINATE_Posterior << ITK_COORDINATE_SecondaryMinor )
00239                                    + ( ITK_COORDINATE_Left << ITK_COORDINATE_TertiaryMinor ),
00240   ITK_COORDINATE_ORIENTATION_IAL = ( ITK_COORDINATE_Inferior
00241                                      << ITK_COORDINATE_PrimaryMinor )
00242                                    + ( ITK_COORDINATE_Anterior << ITK_COORDINATE_SecondaryMinor )
00243                                    + ( ITK_COORDINATE_Left << ITK_COORDINATE_TertiaryMinor ),
00244   ITK_COORDINATE_ORIENTATION_SAL = ( ITK_COORDINATE_Superior
00245                                      << ITK_COORDINATE_PrimaryMinor )
00246                                    + ( ITK_COORDINATE_Anterior << ITK_COORDINATE_SecondaryMinor )
00247                                    + ( ITK_COORDINATE_Left << ITK_COORDINATE_TertiaryMinor ),
00248 
00249   ITK_COORDINATE_ORIENTATION_PIR = ( ITK_COORDINATE_Posterior
00250                                      << ITK_COORDINATE_PrimaryMinor )
00251                                    + ( ITK_COORDINATE_Inferior << ITK_COORDINATE_SecondaryMinor )
00252                                    + ( ITK_COORDINATE_Right << ITK_COORDINATE_TertiaryMinor ),
00253   ITK_COORDINATE_ORIENTATION_PSR = ( ITK_COORDINATE_Posterior
00254                                      << ITK_COORDINATE_PrimaryMinor )
00255                                    + ( ITK_COORDINATE_Superior << ITK_COORDINATE_SecondaryMinor )
00256                                    + ( ITK_COORDINATE_Right << ITK_COORDINATE_TertiaryMinor ),
00257   ITK_COORDINATE_ORIENTATION_AIR = ( ITK_COORDINATE_Anterior
00258                                      << ITK_COORDINATE_PrimaryMinor )
00259                                    + ( ITK_COORDINATE_Inferior << ITK_COORDINATE_SecondaryMinor )
00260                                    + ( ITK_COORDINATE_Right << ITK_COORDINATE_TertiaryMinor ),
00261   ITK_COORDINATE_ORIENTATION_ASR = ( ITK_COORDINATE_Anterior
00262                                      << ITK_COORDINATE_PrimaryMinor )
00263                                    + ( ITK_COORDINATE_Superior << ITK_COORDINATE_SecondaryMinor )
00264                                    + ( ITK_COORDINATE_Right << ITK_COORDINATE_TertiaryMinor ),
00265   ITK_COORDINATE_ORIENTATION_PIL = ( ITK_COORDINATE_Posterior
00266                                      << ITK_COORDINATE_PrimaryMinor )
00267                                    + ( ITK_COORDINATE_Inferior << ITK_COORDINATE_SecondaryMinor )
00268                                    + ( ITK_COORDINATE_Left << ITK_COORDINATE_TertiaryMinor ),
00269   ITK_COORDINATE_ORIENTATION_PSL = ( ITK_COORDINATE_Posterior
00270                                      << ITK_COORDINATE_PrimaryMinor )
00271                                    + ( ITK_COORDINATE_Superior << ITK_COORDINATE_SecondaryMinor )
00272                                    + ( ITK_COORDINATE_Left << ITK_COORDINATE_TertiaryMinor ),
00273   ITK_COORDINATE_ORIENTATION_AIL = ( ITK_COORDINATE_Anterior
00274                                      << ITK_COORDINATE_PrimaryMinor )
00275                                    + ( ITK_COORDINATE_Inferior << ITK_COORDINATE_SecondaryMinor )
00276                                    + ( ITK_COORDINATE_Left << ITK_COORDINATE_TertiaryMinor ),
00277   ITK_COORDINATE_ORIENTATION_ASL = ( ITK_COORDINATE_Anterior
00278                                      << ITK_COORDINATE_PrimaryMinor )
00279                                    + ( ITK_COORDINATE_Superior << ITK_COORDINATE_SecondaryMinor )
00280                                    + ( ITK_COORDINATE_Left << ITK_COORDINATE_TertiaryMinor )
00281   } ValidCoordinateOrientationFlags;
00282 // ^^^
00283 // |||
00284 // ||\Sequential indexes are separated by (planes=rows*columns) memory
00285 // locations
00286 // |\Sequential indexes are separated by rows memory locations (sweep out
00287 // a plane)
00288 // \Sequential indexes are adjacent memory locations (sweep out a row)
00289 
00290 #ifndef __TEMPORARILY_INCLUDED_IN_COMPILATIONS__
00291 typedef enum {
00293   /* is Inferior Right Posterior */
00294 
00296   /* is Inferior Right Anterior */
00297 
00299   /* is Inferior Left Posterior */
00300 
00302   /* is Inferior Left Anterior */
00303 
00305   /* is Superior Right Posterior */
00306 
00308   /* is Superior Right Anterior */
00309 
00311   /* is Superior Left Posterior */
00312 
00314                       /* is Superior Left Anterior */
00315   } ValidOriginFlags;
00316 #endif
00317 } // end of namespace SpatialOrientation
00318 } // end namespace itk
00319 
00320 #endif
00321