ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
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 *=========================================================================*/ 00033 #ifndef __itkSiemensVisionImageIO_h 00034 #define __itkSiemensVisionImageIO_h 00035 00036 00037 #include "itkIPLCommonImageIO.h" 00038 00039 namespace itk 00040 { 00049 class ITK_EXPORT SiemensVisionImageIO:public IPLCommonImageIO 00050 { 00051 public: 00053 typedef SiemensVisionImageIO Self; 00054 typedef IPLCommonImageIO Superclass; 00055 typedef SmartPointer< Self > Pointer; 00056 00058 itkNewMacro(Self); 00059 00061 itkTypeMacro(SiemensVisionImageIO, Superclass); 00062 00063 /*-------- This part of the interfaces deals with reading data. ----- */ 00064 00071 virtual bool CanReadFile(const char *FileNameToRead); 00072 00073 /* * Set the spacing and dimension information for the set filename. */ 00074 // Implemented in superclass 00075 // virtual void ReadImageInformation(); 00076 00077 /* * Get the type of the pixel. */ 00078 // Implemented in superclass 00079 // virtual const std::type_info& GetPixelType() const; 00080 00081 /* * Reads the data from disk into the memory buffer provided. */ 00082 // Implemented in superclass 00083 // virtual void Read(void* buffer); 00084 00085 /* * Compute the size (in bytes) of the components of a pixel. For 00086 * example, and RGB pixel of unsigned char would have a 00087 * component size of 1 byte. */ 00088 // Implemented in superclass 00089 // virtual unsigned int GetComponentSize() const; 00090 00091 /*-------- This part of the interfaces deals with writing data. ----- */ 00092 00093 /* * Determine if the file can be written with this ImageIO implementation. 00094 * \param FileNameToWrite The name of the file to test for writing. 00095 * \author Hans J. Johnson 00096 * \post Sets classes ImageIOBase::m_FileName variable to be FileNameToWrite 00097 * \return Returns true if this ImageIO can write the file specified. 00098 */ 00099 // Implemented in superclass 00100 // virtual bool CanWriteFile(const char * FileNameToWrite); 00101 00102 /* * Set the spacing and dimension information for the set filename. */ 00103 // Implemented in superclass 00104 // virtual void WriteImageInformation(); 00105 00106 /* * Writes the data to disk from the memory buffer provided. Make sure 00107 * that the IORegions has been set properly. */ 00108 // Implemented in superclass 00109 // virtual void Write(const void* buffer); 00110 protected: 00111 SiemensVisionImageIO(); 00112 ~SiemensVisionImageIO(); 00113 // Implemented in superclass 00114 // void PrintSelf(std::ostream& os, Indent indent) const; 00115 virtual GEImageHeader * ReadHeader(const char *FileNameToRead); 00116 00117 private: 00118 typedef enum { 00119 HDR_STUDY_YEAR = 0, // Study date year, u_int 00120 HDR_STUDY_YEAR_LEN = 4, 00121 HDR_STUDY_MONTH = 4, // Study date month, u_int 00122 HDR_STUDY_MONTH_LEN = 4, 00123 HDR_STUDY_DAY = 8, // Study date day, u_int 00124 HDR_STUDY_DAY_LEN = 4, 00125 HDR_ACQ_YEAR = 12, // Acquisition date year, u_int 00126 HDR_ACQ_YEAR_LEN = 4, 00127 HDR_ACQ_MONTH = 16, // Acquisition date month, u_int 00128 HDR_ACQ_MONTH_LEN = 4, 00129 HDR_ACQ_DAY = 20, // Acquisition date day, u_int 00130 HDR_ACQ_DAY_LEN = 4, 00131 HDR_IMAGE_YEAR = 24, // Image date year, u_int 00132 HDR_IMAGE_YEAR_LEN = 4, 00133 HDR_IMAGE_MONTH = 28, // Image date month, u_int 00134 HDR_IMAGE_MONTH_LEN = 4, 00135 HDR_IMAGE_DAY = 32, // Image date day, u_int 00136 HDR_IMAGE_DAY_LEN = 4, 00137 HDR_STUDY_HOUR = 36, // Study time hour, u_int 00138 HDR_STUDY_HOUR_LEN = 4, 00139 HDR_STUDY_MIN = 40, // Study time minute, u_int 00140 HDR_STUDY_MIN_LEN = 4, 00141 HDR_STUDY_SEC = 44, // Study time second, u_int 00142 HDR_STUDY_SEC_LEN = 4, 00143 HDR_ACQ_HOUR = 52, // Acquisition time second, u_int 00144 HDR_ACQ_HOUR_LEN = 4, 00145 HDR_ACQ_MIN = 56, // Acquisition time second, u_int 00146 HDR_ACQ_MIN_LEN = 4, 00147 HDR_ACQ_SEC = 60, // Acquisition time second, u_int 00148 HDR_ACQ_SEC_LEN = 4, 00149 HDR_IMAGE_HOUR = 68, // Image Creation time second, u_int 00150 HDR_IMAGE_HOUR_LEN = 4, 00151 HDR_IMAGE_MIN = 72, // Image Creation time second, u_int 00152 HDR_IMAGE_MIN_LEN = 4, 00153 HDR_IMAGE_SEC = 76, // Image Creation time second, u_int 00154 HDR_IMAGE_SEC_LEN = 4, 00155 HDR_MANUFAC = 96, // Scanner Manufacturer, char 00156 HDR_MANUFAC_LEN = 7, 00157 HDR_INSTUTE_NAME = 105, // Institution Name, char 00158 HDR_INSTUTE_NAME_LEN = 25, 00159 HDR_ANNOTATION = 186, // Annotation, char 00160 HDR_ANNOTATION_LEN = 32, 00161 HDR_MODEL_NAME = 281, // Scanner Model Name, char 00162 HDR_MODEL_NAME_LEN = 12, 00163 HDR_LMOVE_YEAR = 412, // Date of Last Image Move - year, u_int 00164 HDR_LMOVE_YEAR_LEN = 4, 00165 HDR_LMOVE_MONTH = 416, // Date of Last Image Move - month, u_int 00166 HDR_LMOVE_MONTH_LEN = 4, 00167 HDR_LMOVE_DAY = 420, // Date of Last Image Move - day, u_int 00168 HDR_LMOVE_DAY_LEN = 4, 00169 HDR_LMOVE_HOUR = 424, // Date of Last Image Move - hour, u_int 00170 HDR_LMOVE_HOUR_LEN = 4, 00171 HDR_LMOVE_MIN = 428, // Date of Last Image Move - minute, u_int 00172 HDR_LMOVE_MIN_LEN = 4, 00173 HDR_LMOVE_SEC = 432, // Date of Last Image Move - second, u_int 00174 HDR_LMOVE_SEC_LEN = 4, 00175 HDR_PAT_NAME = 768, // Patient Name, char 00176 HDR_PAT_NAME_LEN = 25, 00177 HDR_PAT_ID = 795, // Patient ID Number, char 00178 HDR_PAT_ID_LEN = 12, 00179 HDR_DOB_YEAR = 808, // Date of Birth year, u_int 00180 HDR_DOB_YEAR_LEN = 4, 00181 HDR_DOB_MONTH = 812, // Date of Birth month, u_int 00182 HDR_DOB_MONTH_LEN = 4, 00183 HDR_DOB_DAY = 816, // Date of Birth day, u_int 00184 HDR_DOB_DAY_LEN = 4, 00185 HDR_PAT_AGE = 851, // Patient Age, char 00186 HDR_PAT_AGE_LEN = 3, 00187 HDR_AGE_UNIT = 854, // Patient Age Unit, char 00188 HDR_AGE_UNIT_LEN = 1, 00189 HDR_REG_YEAR = 1052, // Registration Date year, u_int 00190 HDR_REG_YEAR_LEN = 4, 00191 HDR_REG_MONTH = 1056, // Registration Date month, u_int 00192 HDR_REG_MONTH_LEN = 4, 00193 HDR_REG_DAY = 1060, // Registration Date day, u_int 00194 HDR_REG_DAY_LEN = 4, 00195 HDR_REG_HOUR = 1064, // Registration Time hour, u_int 00196 HDR_REG_HOUR_LEN = 4, 00197 HDR_REG_MIN = 1068, // Registration Time minute, u_int 00198 HDR_REG_MIN_LEN = 4, 00199 HDR_REG_SEC = 1072, // Registration Time second, u_int 00200 HDR_REG_SEC_LEN = 4, 00201 HDR_SLICE_THCK = 1544, // Slice thickness, double 00202 HDR_SLICE_THCK_LEN = 8, 00203 HDR_TR = 1560, // TR, double 00204 HDR_TR_LEN = 8, 00205 HDR_TE = 1568, // TE, double 00206 HDR_TE_LEN = 8, 00207 HDR_FREQ = 1592, // Center Frequency, double 00208 HDR_FREQ_LEN = 8, 00209 HDR_STATION = 1639, // Station Name, char 00210 HDR_STATION_LEN = 5, 00211 HDR_CAL_YEAR = 1712, // Calibration Date - year, u_int 00212 HDR_CAL_YEAR_LEN = 4, 00213 HDR_CAL_MONTH = 1716, // Calibration Date - month, u_int 00214 HDR_CAL_MONTH_LEN = 4, 00215 HDR_CAL_DAY = 1720, // Calibration Date - day, u_int 00216 HDR_CAL_DAY_LEN = 4, 00217 HDR_CAL_HOUR = 1724, // Calibration Time - hour, u_int 00218 HDR_CAL_HOUR_LEN = 4, 00219 HDR_CAL_MIN = 1728, // Calibration Time - minute, u_int 00220 HDR_CAL_MIN_LEN = 4, 00221 HDR_CAL_SEC = 1732, // Calibration Time - second, u_int 00222 HDR_CAL_SEC_LEN = 4, 00223 HDR_COIL = 1767, // Recieve Coil, char 00224 HDR_COIL_LEN = 16, 00225 HDR_IMAGE_NUC = 1828, // Imaged Nucleus, char 00226 HDR_IMAGE_NUC_LEN = 4, 00227 HDR_FLIP_ANGLE = 2112, // Flip Angle, double 00228 HDR_FLIP_ANGLE_LEN = 8, 00229 HDR_FIELD = 2560, // Field Strength, double 00230 HDR_FIELD_LEN = 8, 00231 HDR_DISPLAY_SIZE = 2864, // Displayed Matrix Size, u_int 00232 HDR_DISPLAY_SIZE_LEN = 4, 00233 HDR_SEQPROG_NAME = 2944, // Pulse Sequence Program Name, cha 00234 HDR_SEQPROG_NAME_LEN = 65, 00235 HDR_WKC_NAME = 3009, // Pulse Sequence Name, char 00236 HDR_WKC_NAME_LEN = 65, 00237 HDR_AUTHOR = 3074, // Pulse Sequence Author, char 00238 HDR_AUTHOR_LEN = 9, 00239 HDR_SEQUENCE_TYPE = 3083, // Pulse Sequence Type, char 00240 HDR_SEQUENCE_TYPE_LEN = 8, 00241 HDR_FOV_ROW = 3744, // Row FOV, double 00242 HDR_FOV_ROW_LEN = 8, 00243 HDR_FOV_COLUMN = 3752, // Column FOV, double 00244 HDR_FOV_COLUMN_LEN = 8, 00245 HDR_CENTER_X = 3768, // X Center Point, double 00246 HDR_CENTER_X_LEN = 8, 00247 HDR_CENTER_Y = 3776, // Y Center Point, double 00248 HDR_CENTER_Y_LEN = 8, 00249 HDR_CENTER_Z = 3784, // Z Center Point, double 00250 HDR_CENTER_Z_LEN = 8, 00251 HDR_NORMV_X = 3792, // Nornal Vector X, double 00252 HDR_NORMV_X_LEN = 8, 00253 HDR_NORMV_Y = 3800, // Nornal Vector Y, double 00254 HDR_NORMV_Y_LEN = 8, 00255 HDR_NORMV_Z = 3808, // Nornal Vector Z, double 00256 HDR_NORMV_Z_LEN = 8, 00257 HDR_DIST_ISO = 3816, // Distance from Isocenter, double 00258 HDR_DIST_ISO_LEN = 8, 00259 HDR_ROWV_X = 3832, // Row vector X, double 00260 HDR_ROWV_X_LEN = 8, 00261 HDR_ROWV_Y = 3840, // Row vector Y, double 00262 HDR_ROWV_Y_LEN = 8, 00263 HDR_ROWV_Z = 3848, // Row vector Z, double 00264 HDR_ROWV_Z_LEN = 8, 00265 HDR_COLMNV_X = 3856, // Column vector X, double 00266 HDR_COLMNV_X_LEN = 8, 00267 HDR_COLMNV_Y = 3864, // Column vector Y, double 00268 HDR_COLMNV_Y_LEN = 8, 00269 HDR_COLMNV_Z = 3872, // Column vector Z, double 00270 HDR_COLMNV_Z_LEN = 8, 00271 HDR_ORNT_SET1X = 3880, // Orientation Set 1 - X, char 00272 HDR_ORNT_SET1X_LEN = 3, 00273 HDR_ORNT_SET1Y = 3884, // Orientation Set 1 - Y, char 00274 HDR_ORNT_SET1Y_LEN = 3, 00275 HDR_ORNT_SET1Z = 3888, // Orientation Set 1 - Z, char 00276 HDR_ORNT_SET1Z_LEN = 3, 00277 HDR_ORNT_SET2X = 3892, // Orientation Set 2 - X, char 00278 HDR_ORNT_SET2X_LEN = 3, 00279 HDR_ORNT_SET2Y = 3896, // Orientation Set 2 - Y, char 00280 HDR_ORNT_SET2Y_LEN = 3, 00281 HDR_ORNT_SET2Z = 3900, // Orientation Set 2 - Z, char 00282 HDR_ORNT_SET2Z_LEN = 3, 00283 HDR_PROTOCOL_NAME = 2944, // Pulse Sequence Name, char 00284 HDR_PROTOCOL_NAME_LEN = 64, 00285 HDR_PIXELSIZE_ROW = 5000, // Row Pixel Size, double 00286 HDR_PIXELSIZE_ROW_LEN = 8, 00287 HDR_PIXELSIZE_CLMN = 5008, // Column Pixel Size, double 00288 HDR_PIXELSIZE_CLMN_LEN = 8, 00289 TEXT_PAT_ID = 5504, // Text Patient ID, char 00290 TEXT_PAT_ID_LEN = 12, 00291 TEXT_PAT_SEX = 5517, // Text Patient Sex, char 00292 TEXT_PAT_SEX_LEN = 1, 00293 TEXT_PAT_AGE = 5518, // Text Patient Age, char 00294 TEXT_PAT_AGE_LEN = 3, 00295 TEXT_AGE_UNIT = 5521, // Text Patient Age Unit (Y=year), char 00296 TEXT_AGE_UNIT_LEN = 1, 00297 TEXT_PAT_POS = 5529, // Text Patient Postion, char 00298 TEXT_PAT_POS_LEN = 7, 00299 TEXT_IMG_FLAG = 5541, // Text Image Flag (IMAGE=image), char 00300 TEXT_IMG_FLAG_LEN = 5, 00301 TEXT_IMG_NUMBER = 5546, // Text Image Number, char 00302 TEXT_IMG_NUMBER_LEN = 4, 00303 TEXT_IMG_DAY = 5559, // Text Date - Day, char 00304 TEXT_IMG_DAY_LEN = 2, 00305 TEXT_IMG_MONTH = 5562, // Text Date - Month, char 00306 TEXT_IMG_MONTH_LEN = 3, 00307 TEXT_IMG_YEAR = 5566, // Text Date - Year, char 00308 TEXT_IMG_YEAR_LEN = 4, 00309 TEXT_IMG_HOUR = 5571, // Text Time - hour, char 00310 TEXT_IMG_HOUR_LEN = 2, 00311 TEXT_IMG_MIN = 5574, // Text Time - minute, char 00312 TEXT_IMG_MIN_LEN = 2, 00313 TEXT_ACQ_FLAG = 5577, // Text Acq. Time Flag (TA=time of acq), char 00314 TEXT_ACQ_FLAG_LEN = 2, 00315 TEXT_ACQ_MIN = 5583, // Text Acq Time - minute, char 00316 TEXT_ACQ_MIN_LEN = 2, 00317 TEXT_ACQ_SEC = 5586, // Text Acq Time - second, char 00318 TEXT_ACQ_SEC_LEN = 2, 00319 TEXT_ANNOTATION = 5601, // Text Annotation, char 00320 TEXT_ANNOTATION_LEN = 32, 00321 TEXT_ORGANIZATION = 5655, // Text Organization, char 00322 TEXT_ORGANIZATION_LEN = 25, 00323 TEXT_STATION = 5682, // Text Station Name, char 00324 TEXT_STATION_LEN = 5, 00325 TEXT_ACQ_MTRX_PHASE = 5695, // Acq. Matrix Phase Axis, char 00326 TEXT_ACQ_MTRX_PHASE_LEN = 3, 00327 TEXT_ACQ_PHASE_DIR = 5698, // Acq. phase direction (h=hor, v=vert), char 00328 TEXT_ACQ_PHASE_DIR_LEN = 1, 00329 TEXT_ACQ_MTRX_FREQ = 5700, // Acq. matrix Freq Axis, char 00330 TEXT_ACQ_MTRX_FREQ_LEN = 3, 00331 TEXT_ACQ_MTRX_FREQO = 5703, // Acq freq (o=o " "=blank), char 00332 TEXT_ACQ_MTRX_FREQO_LEN = 1, 00333 TEXT_ACQ_MTRX_FREQS = 5704, // Acq freq (s=s " "=blank), char 00334 TEXT_ACQ_MTRX_FREQS_LEN = 1, 00335 TEXT_SEQUENCE = 5706, // Sequence Type, char 00336 TEXT_SEQUENCE_LEN = 8, 00337 TEXT_FLIP_ANGLE = 5714, // Flip Angle, char 00338 TEXT_FLIP_ANGLE_LEN = 3, 00339 TEXT_SCAN_FLAG = 5718, // Scan flag ("SCAN"), char */ 00340 TEXT_SCAN_FLAG_LEN = 4, 00341 TEXT_SCANA_NUM = 5723, // Scan Number A, char 00342 TEXT_SCANA_NUM_LEN = 3, 00343 TEXT_SCANB_NUM = 5726, // Scan Number B, char 00344 TEXT_SCANB_NUM_LEN = 3, 00345 TEXT_TR_FLAG = 5730, // TR flag ("TR"), char 00346 TEXT_TR_FLAG_LEN = 2, 00347 TEXT_TR = 5734, // TR, char 00348 TEXT_TR_LEN = 7, 00349 TEXT_TE_FLAG = 5742, // TE flag ("TE"), char 00350 TEXT_TE_FLAG_LEN = 2, 00351 TEXT_TE = 5746, // TE, char 00352 TEXT_TE_LEN = 5, 00353 TEXT_ECHO_NUM = 5752, // Echo number, char 00354 TEXT_ECHO_NUM_LEN = 1, 00355 TEXT_THCK_FLAG = 5790, // SLice thickness flag ("SL"), char 00356 TEXT_THCK_FLAG_LEN = 2, 00357 TEXT_SLICE_THCK = 5794, // Slice thickness 00358 TEXT_SLICE_THCK_LEN = 7, 00359 TEXT_POS_FLAG = 5802, // Slice postion flag ("SP"), char 00360 TEXT_POS_FLAG_LEN = 2, 00361 TEXT_SLICE_POS = 5806, // Slice postion, char 00362 TEXT_SLICE_POS_LEN = 7, 00363 TEXT_ANGLE_FLAG1 = 5814, // Angle flag 1 ("Sag","Cor",or,"Tra"), char 00364 TEXT_ANGLE_FLAG1_LEN = 3, 00365 TEXT_ANGLE_FLAG2 = 5817, // Angle flag 2 ("<", or ">"), char 00366 TEXT_ANGLE_FLAG2_LEN = 1, 00367 TEXT_ANGLE_FLAG3 = 5818, // Angle flag 3 ("Sag","Cor",or,"Tra"), char 00368 TEXT_ANGLE_FLAG3_LEN = 3, 00369 TEXT_ANGLE = 5821, // Angle, char 00370 TEXT_ANGLE_LEN = 4, 00371 TEXT_FOV_FLAG = 5838, // FOV flag ("FOV"), char 00372 TEXT_FOV_FLAG_LEN = 3, 00373 TEXT_FOVH = 5842, // Horizontal FOV, char 00374 TEXT_FOVH_LEN = 3, 00375 TEXT_FOVV = 5846, // Vertical FOV, char 00376 TEXT_FOVV_LEN = 3, 00377 TEXT_TABLEPOS_FLAG = 5874, // Table Postion flag ("TP"), char 00378 TEXT_TABLEPOS_FLAG_LEN = 2, 00379 TEXT_TABLE_POS = 5878, // Table postion 00380 TEXT_TABLE_POS_LEN = 7, 00381 TEXT_STUDY_FLAG = 5938, // Study flag ("STUDY"), char 00382 TEXT_STUDY_FLAG_LEN = 5, 00383 TEXT_STUDY_NUM = 5943, // Study number, char 00384 TEXT_STUDY_NUM_LEN = 2, 00385 TEXT_DOB_DAY = 5956, // Date of Birth - day, char 00386 TEXT_DOB_DAY_LEN = 2, 00387 TEXT_DOB_MONTH = 5959, // Date of Birth - month, char 00388 TEXT_DOB_MONTH_LEN = 3, 00389 TEXT_DOB_YEAR = 5963, // Date of Birth - year, char 00390 TEXT_DOB_YEAR_LEN = 4, 00391 TEXT_STUDY_FLAG2 = 5992, // Study flag 2 ("STU"), char 00392 TEXT_STUDY_FLAG2_LEN = 3, 00393 TEXT_IMAGE_FLAG2 = 5996, // Image flag 2 ("IMA"), char 00394 TEXT_IMAGE_FLAG2_LEN = 3, 00395 TEXT_STUDY_NUM2 = 5999, // Study number 2, char 00396 TEXT_STUDY_NUM2_LEN = 2, 00397 TEXT_IMAGE_NUM2 = 6002, // Image number 2, char 00398 TEXT_IMAGE_NUM2_LEN = 2, 00399 TEXT_IMAGE_NUM3 = 6013, // Image number 3, char 00400 TEXT_IMAGE_NUM3_LEN = 5, 00401 TEXT_MODEL_NAME = 6031, // Model Name, char 00402 TEXT_MODEL_NAME_LEN = 15, 00403 TEXT_PAT_NAME = 6058, // Patient Name, char 00404 TEXT_PAT_NAME_LEN = 25, 00405 TEXT_START_HOUR = 6085, // Scan start time - hour, char 00406 TEXT_START_HOUR_LEN = 2, 00407 TEXT_START_MIN = 6088, // Scan start time - minute, char 00408 TEXT_START_MIN_LEN = 2, 00409 TEXT_START_SEC = 6091, // Scan start time - second, char 00410 TEXT_START_SEC_LEN = 2, 00411 HDR_TOTAL_LENGTH = 6144 // Total length of Siemens Header 00412 } SiemensVisionHeaderInfo; 00413 SiemensVisionImageIO(const Self &); //purposely not implemented 00414 void operator=(const Self &); //purposely not implemented 00415 }; 00416 } // end namespace itk 00417 00418 #endif // __itkSiemensVisionImageIO_h 00419