Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkPhilipsPAR.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkPhilipsPAR.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-06-23 22:04:35 $
00007   Version:   $Revision: 1.3 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 
00033 #ifndef __itkPhilipsPAR_h
00034 #define __itkPhilipsPAR_h
00035 
00036 #include <stdio.h>
00037 #include <stdlib.h>
00038 #include <string>
00039 #include "itkVectorContainer.h"
00040 #include "vnl/vnl_vector_fixed.h"
00041 
00042 #define RESEARCH_IMAGE_EXPORT_TOOL_V3  3
00043 #define RESEARCH_IMAGE_EXPORT_TOOL_V4  4
00044 #define RESEARCH_IMAGE_EXPORT_TOOL_V4_1  41
00045 
00046 #define PAR_DEFAULT_STRING_LENGTH      32
00047 #define PAR_DEFAULT_TRIGGER_TIMES_SIZE    128
00048 #define PAR_DEFAULT_ECHO_TIMES_SIZE      128
00049 #define PAR_DEFAULT_REP_TIMES_SIZE      128
00050 #define PAR_DEFAULT_IMAGE_TYPES_SIZE    8
00051 #define PAR_DEFAULT_SCAN_SEQUENCE_SIZE    8
00052 #define PAR_RESCALE_VALUES_SIZE        3
00053 #define PAR_DIFFUSION_VALUES_SIZE      3
00054 
00055 #define PAR_SLICE_ORIENTATION_TRANSVERSAL  1
00056 #define PAR_SLICE_ORIENTATION_SAGITTAL    2
00057 #define PAR_SLICE_ORIENTATION_CORONAL    3
00058 
00059 namespace itk
00060 {
00061 
00065 struct par_parameter  //par_parameter
00066 {
00067   int problemreading; // Marked 1 if problem occurred reading in PAR file
00068   int ResToolsVersion; // V3, V4, or V4.1 PAR/REC version
00069   char patient_name[PAR_DEFAULT_STRING_LENGTH]; // Patient name
00070   char exam_name[PAR_DEFAULT_STRING_LENGTH]; // Examination name
00071   char protocol_name[PAR_DEFAULT_STRING_LENGTH]; // Protocol name
00072   char exam_date[PAR_DEFAULT_STRING_LENGTH]; // Examination date/time
00073   char exam_time[PAR_DEFAULT_STRING_LENGTH]; // Examination date/time
00074   char series_type[PAR_DEFAULT_STRING_LENGTH]; // Series Type
00075   int scno; // Acquisition nr
00076   int recno; // Reconstruction nr
00077   int scan_duration; // Scan Duration [sec]
00078   int cardiac_phases; // Max. number of cardiac phases
00079   float trigger_times[PAR_DEFAULT_TRIGGER_TIMES_SIZE]; // trigger_time (float)
00080   int echoes; // Max. number of echoes
00081   float echo_times[PAR_DEFAULT_ECHO_TIMES_SIZE]; // Echo times read from PAR file
00082   int slice; // Max. number of slices/locations
00083   int dyn; // Max. number of dynamics
00084   int mixes; // Max. number of mixes
00085   char patient_position[PAR_DEFAULT_STRING_LENGTH]; // Patient position
00086   char prep_direction[PAR_DEFAULT_STRING_LENGTH]; // Preparation direction
00087   short int bit; // Image pixel size [8 or 16 bits]
00088   char technique[PAR_DEFAULT_STRING_LENGTH]; // Technique
00089   char scan_mode[PAR_DEFAULT_STRING_LENGTH]; // Scan mode
00090   int num_averages; // Number of averages
00091   int scan_resolution[2]; // Scan resolution  (x, y)
00092   int scan_percent; // Scan percentage
00093   int dim[3]; // Recon resolution (x, y) + slices (z)
00094   float repetition_time[PAR_DEFAULT_REP_TIMES_SIZE]; // Repetition time [msec]
00095   int sliceorient; // slice orientation ( TRA/SAG/COR ) (integer)
00096   float slth; // Slice thickness [mm]
00097   float gap; // Slice gap [mm]
00098   float fov[3]; // FOV (ap,fh,rl) [mm]
00099   float water_fat_shift; // Water Fat shift [pixels]
00100   float angAP; // Angulation midslice(ap,fh,rl)[degr]
00101   float angFH; // Angulation midslice(ap,fh,rl)[degr]
00102   float angRL; // Angulation midslice(ap,fh,rl)[degr]
00103   float offAP; // Off Centre midslice(ap,fh,rl) [mm]
00104   float offFH; // Off Centre midslice(ap,fh,rl) [mm]
00105   float offRL; // Off Centre midslice(ap,fh,rl) [mm]
00106   int flow_comp; // Flow compensation <0=no 1=yes> ?
00107   int presaturation; // Presaturation     <0=no 1=yes> ?
00108   int cardiac_freq; // Cardiac frequency
00109   int min_rr_int; // Min. RR interval
00110   int max_rr_int; // Max. RR interval
00111   float phase_encode_vel[3]; // Phase encoding velocity [cm/sec]
00112   int mtc; // MTC               <0=no 1=yes> ?
00113   int spir; // SPIR              <0=no 1=yes> ?
00114   int epi; // EPI factor        <0,1=no EPI>
00115   int turbo; // TURBO factor      <0=no turbo>
00116   int dynamic_scan; // Dynamic scan      <0=no 1=yes> ?
00117   int diffusion; // Diffusion         <0=no 1=yes> ?
00118   float diff_echo; // Diffusion echo time [msec]
00119   int max_num_diff_vals; // Max. number of diffusion values
00120   int max_num_grad_orient; // Max. number of gradient orients
00121   float inversion_delay; // Inversion delay [msec]
00122   float vox[3]; // pixel spacing (x,y) (in mm)
00123   int slicessorted; // 1-slices sorted, 0-slices not sorted
00124   int image_blocks; // The total number of image blocks stored in the REC file
00125   int num_image_types; // The number of image types in the REC file
00126   int image_types[PAR_DEFAULT_IMAGE_TYPES_SIZE]; // The different image types 
00127                                                  // detected in the REC
00128   int num_scanning_sequences; // The number of scanning sequences in the REC file
00129   int scanning_sequences[PAR_DEFAULT_SCAN_SEQUENCE_SIZE]; // The different 
00130                                                           // scanning sequences 
00131                                                           // detected in the REC
00132   int num_slice_repetitions; // If num_scanning_sequences > 1 then 
00133                   // num_image_types may not equal the total number of slice 
00134                   // repetitions for a single acquisition.  This value is the 
00135                   // total number of slice repetitions for a single acquisition 
00136                   // and is valid only when slicessorted == 0.
00138 
00139 };
00140 
00141 // Reads the PAR file parameters in "parFile" and stores the PAR parameters in 
00142 // pPar.
00143 // Returns false if an error is encountered during reading, otherwise true is 
00144 // returned.
00145 ITK_EXPORT bool ReadPAR(std::string parFile, struct par_parameter* pPar);
00146 
00147 // Returns a vector of paired values, the first contains the slice index and the 
00148 // second is the image type for the PAR file "parFile".
00149 typedef std::pair< int, int >                 PARSliceIndexImageType;
00150 typedef std::vector< PARSliceIndexImageType > PARSliceIndexImageTypeVector;
00151 ITK_EXPORT PARSliceIndexImageTypeVector GetRECSliceIndexImageTypes(
00152   std::string parFile);
00153 
00154 // Returns a vector of paired values, the first contains the slice index and the 
00155 // second is the scan sequence for the PAR file "parFile".
00156 typedef std::pair< int, int >                    PARSliceIndexScanSequence;
00157 typedef std::vector< PARSliceIndexScanSequence > PARSliceIndexScanSequenceVector;
00158 ITK_EXPORT PARSliceIndexScanSequenceVector GetRECSliceIndexScanningSequence(
00159   std::string parFile);
00160 
00161 // Returns a vector of paired values, the first contains the image type and the 
00162 // second is the scan sequence for that image type for the PAR file "parFile".
00163 typedef std::pair< int, int >                   PARImageTypeScanSequence;
00164 typedef std::vector< PARImageTypeScanSequence > PARImageTypeScanSequenceVector;
00165 ITK_EXPORT PARImageTypeScanSequenceVector GetImageTypesScanningSequence(
00166   std::string parFile);
00167 
00168 // Stores rescale values in the VectorContainer "rescaleValues" for each image 
00169 // type of the specified scan sequence number "scan_sequence" (from 
00170 // scanning_sequences) for the PAR file "parFile".
00171 // Returns false if an error is encountered during reading, otherwise true is 
00172 // returned.
00173 typedef vnl_vector_fixed< double, PAR_RESCALE_VALUES_SIZE > 
00174 PARRescaleValues;
00175 typedef VectorContainer< unsigned int, PARRescaleValues > 
00176 PARRescaleValuesContainer;
00177 ITK_EXPORT bool GetRECRescaleValues(std::string parFile,
00178   PARRescaleValuesContainer *rescaleValues, int scan_sequence);
00179 
00180 // Stores the diffusion gradient values in the VectorContainer "gradientValues" 
00181 // and the diffusion b values in the VectorContainer "bValues" for each gradient 
00182 // direction in the PAR file "parFile".
00183 // Returns false if an error is encountered during reading, otherwise true is 
00184 // returned.
00185 typedef vnl_vector_fixed< double, PAR_DIFFUSION_VALUES_SIZE > 
00186 PARDiffusionValues;
00187 typedef VectorContainer< unsigned int, PARDiffusionValues >
00188 PARDiffusionValuesContainer;
00189 typedef VectorContainer< unsigned int, double > 
00190 PARBValuesContainer;
00191 ITK_EXPORT bool GetDiffusionGradientOrientationAndBValues(std::string parFile,
00192   PARDiffusionValuesContainer *gradientValues, PARBValuesContainer *bValues);
00193 
00194 } // end namespace itk
00195 
00196 #endif                           /* __itkPhilipsPAR_h */
00197 

Generated at Wed Nov 5 23:30:07 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000