itkPhilipsPAR.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
00066 {
00067 int problemreading;
00068 int ResToolsVersion;
00069 char patient_name[PAR_DEFAULT_STRING_LENGTH];
00070 char exam_name[PAR_DEFAULT_STRING_LENGTH];
00071 char protocol_name[PAR_DEFAULT_STRING_LENGTH];
00072 char exam_date[PAR_DEFAULT_STRING_LENGTH];
00073 char exam_time[PAR_DEFAULT_STRING_LENGTH];
00074 char series_type[PAR_DEFAULT_STRING_LENGTH];
00075 int scno;
00076 int recno;
00077 int scan_duration;
00078 int cardiac_phases;
00079 float trigger_times[PAR_DEFAULT_TRIGGER_TIMES_SIZE];
00080 int echoes;
00081 float echo_times[PAR_DEFAULT_ECHO_TIMES_SIZE];
00082 int slice;
00083 int dyn;
00084 int mixes;
00085 char patient_position[PAR_DEFAULT_STRING_LENGTH];
00086 char prep_direction[PAR_DEFAULT_STRING_LENGTH];
00087 short int bit;
00088 char technique[PAR_DEFAULT_STRING_LENGTH];
00089 char scan_mode[PAR_DEFAULT_STRING_LENGTH];
00090 int num_averages;
00091 int scan_resolution[2];
00092 int scan_percent;
00093 int dim[3];
00094 float repetition_time[PAR_DEFAULT_REP_TIMES_SIZE];
00095 int sliceorient;
00096 float slth;
00097 float gap;
00098 float fov[3];
00099 float water_fat_shift;
00100 float angAP;
00101 float angFH;
00102 float angRL;
00103 float offAP;
00104 float offFH;
00105 float offRL;
00106 int flow_comp;
00107 int presaturation;
00108 int cardiac_freq;
00109 int min_rr_int;
00110 int max_rr_int;
00111 float phase_encode_vel[3];
00112 int mtc;
00113 int spir;
00114 int epi;
00115 int turbo;
00116 int dynamic_scan;
00117 int diffusion;
00118 float diff_echo;
00119 int max_num_diff_vals;
00120 int max_num_grad_orient;
00121 float inversion_delay;
00122 float vox[3];
00123 int slicessorted;
00124 int image_blocks;
00125 int num_image_types;
00126 int image_types[PAR_DEFAULT_IMAGE_TYPES_SIZE];
00127
00128 int num_scanning_sequences;
00129 int scanning_sequences[PAR_DEFAULT_SCAN_SEQUENCE_SIZE];
00130
00131
00132 int num_slice_repetitions;
00133
00134
00135
00136
00138
00139 };
00140
00141
00142
00143
00144
00145 ITK_EXPORT bool ReadPAR(std::string parFile, struct par_parameter* pPar);
00146
00147
00148
00149 typedef std::pair< int, int > PARSliceIndexImageType;
00150 typedef std::vector< PARSliceIndexImageType > PARSliceIndexImageTypeVector;
00151 ITK_EXPORT PARSliceIndexImageTypeVector GetRECSliceIndexImageTypes(
00152 std::string parFile);
00153
00154
00155
00156 typedef std::pair< int, int > PARSliceIndexScanSequence;
00157 typedef std::vector< PARSliceIndexScanSequence > PARSliceIndexScanSequenceVector;
00158 ITK_EXPORT PARSliceIndexScanSequenceVector GetRECSliceIndexScanningSequence(
00159 std::string parFile);
00160
00161
00162
00163 typedef std::pair< int, int > PARImageTypeScanSequence;
00164 typedef std::vector< PARImageTypeScanSequence > PARImageTypeScanSequenceVector;
00165 ITK_EXPORT PARImageTypeScanSequenceVector GetImageTypesScanningSequence(
00166 std::string parFile);
00167
00168
00169
00170
00171
00172
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
00181
00182
00183
00184
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 }
00195
00196 #endif
00197