SIVIC API  0.9.26
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
svkGEPFileReader Class Reference

#include <svkGEPFileReader.h>

Inheritance diagram for svkGEPFileReader:
svkImageReader2

Public Member Functions

 vtkTypeMacro (svkGEPFileReader, svkImageReader2)
 
virtual int CanReadFile (const char *fname)
 
svkGEPFileMapperGetMapper ()
 
void SetMapperBehavior (svkGEPFileMapper::MapperBehavior type)
 
void SetDeidentify (svkDcmHeader::PHIType phiType)
 
void SetDeidentify (svkDcmHeader::PHIType phiType, string deidentificationId)
 
void SetDeidentify (svkDcmHeader::PHIType phiType, string patientId, string studyId)
 
void SetDeidentificationStudyUID (string deidStudyUID)
 
void SetDeidentificationSeriesUID (string deidSeriesUID)
 
void SetDeidentificationInstanceUID (string deidImageUID)
 
void SetDeidentificationLandmarkUID (string deidLandmarkUID)
 
void SetTemperature (float temp)
 
void SetChop (bool chop)
 
void PrintHeader ()
 
void PrintShortHeader ()
 
void SetEPSIParams (svkEPSIReorder::EPSIType type, svkEPSIReorder::EPSIAxis axis, int first, int numLobes, int numSkip)
 
void Deidentify ()
 
void ModifyRawField (string rawField, string value)
 
void SetPSDLogic (string psdName)
 
map< string, vector< string > > GetPFMap ()
 
virtual const char * GetDescriptiveName ()
 
virtual svkImageReader2::ReaderType GetReaderType ()
 
- Public Member Functions inherited from svkImageReader2
 vtkTypeMacro (svkImageReader2, vtkImageReader2)
 
svkImageDataGetOutput ()
 
svkImageDataGetOutput (int)
 
svkDcmHeaderGetDcmHeader (const char *fileName)
 
void OnlyReadOneInputFile ()
 
void OnlyGlobFiles ()
 
void GlobFileNames ()
 
void OnlyReadHeader (bool onlyReadHeader)
 

Static Public Member Functions

static svkGEPFileReaderNew ()
 
static float LookupRawVersion (float rdbmRev, float rdbmRevSwapped)
 
- Static Public Member Functions inherited from svkImageReader2
static string StripWhite (string in)
 
static string RemoveDelimFromDate (string *slashDate, char delimChar= '/')
 
static string GetFileRoot (const char *fname)
 
static string GetFileExtension (const char *fname)
 
static string GetFilePath (const char *fname)
 
static string GetFileNameWithoutPath (const char *fname)
 
static long GetFileSize (ifstream *fs)
 

Public Attributes

bool checkSeriesUID
 

Protected Member Functions

 svkGEPFileReader ()
 
 ~svkGEPFileReader ()
 
virtual int FillOutputPortInformation (int port, vtkInformation *info)
 
virtual void ExecuteInformation ()
 
virtual void ExecuteDataWithInformation (vtkDataObject *output, vtkInformation *outInfo)
 
virtual
svkDcmHeader::DcmPixelDataFormat 
GetFileType ()
 
void ReadGEPFile ()
 
void ParsePFile ()
 
void InitOffsetsMap ()
 
virtual void SetProvenance ()
 
virtual string GetFileSeriesDescription (string fileName)
 
- Protected Member Functions inherited from svkImageReader2
 svkImageReader2 ()
 
 ~svkImageReader2 ()
 
void SetupOutputInformation ()
 
void SetupOutputExtent ()
 
void SetupOutputScalarData ()
 
virtual void ReadLine (ifstream *hdr, istringstream *iss)
 
void ReadLineIgnore (ifstream *hdr, istringstream *iss, char delim)
 
string ReadLineSubstr (ifstream *hdr, istringstream *iss, int start, int stop)
 
string ReadLineValue (ifstream *hdr, istringstream *iss, char delim)
 
int ReadLineKeyValue (ifstream *hdr, istringstream *iss, char delim, string *key, string *value)
 
void SetReadLength (int length)
 

Protected Attributes

map< string, vector< string > > pfMap
 
- Protected Attributes inherited from svkImageReader2
vtkDataArray * dataArray
 
bool readOneInputFile
 
bool onlyGlobFiles
 
bool onlyReadHeader
 

Additional Inherited Members

- Public Types inherited from svkImageReader2
enum  ReaderType {
  UNDEFINED = -1, DICOM_MRS =0, DICOM_MRI, DICOM_ENHANCED_MRI,
  DICOM_SEGMENTATION, DICOM_RAW, SIEMENS_RDA, VARIAN_FID,
  VARIAN_FDF, GE_PFILE, GE_SDBM, GE_POSTAGE_STAMP,
  GE_SIGNA_LX2, GE_SIGNA_5X, LC_MODEL_COORD, LC_MODEL_CSV,
  LC_MODEL_TABLE, VARIABLE_FLIP_DAT, BRUKER_MRS, PHILIPS_S,
  DDF, IDF, LAST_TYPE = IDF
}
 

Detailed Description

This is an svkImageReader2 for reading GE P-files. The reader supports 9.x - 20.x raw file versions. The reader reads fields from GE P-files, putting the content into a string map. The reader then obtains a svkGEPFileMapper for the specific PSD in order to map that content to an svkMrsImageData object (and svkDcmHeader representing a DICOM MR Spectroscopy SOP Class UID). The mapping will depend on the specific psd context, for example because of variability in meaning of user cvs.

A mapper factory will ultimatly be developed to obtain the appropriate svkPFileMapper for a given Pfile.

Thanks to Mike Figueira of GE Medical for helful discussions about the class design. Many thanks also to Sanjay Joshi( GE Medical recon ), Mike Figueira (GEMS) and Katie McMillan (GEMS) for their help making this possible.

Acknowledgments: Dr. Ping-Hong Yeh for providing sample data for validating 21.x support.

Constructor & Destructor Documentation

svkGEPFileReader ( )
protected
~svkGEPFileReader ( )
protected

Member Function Documentation

int CanReadFile ( const char *  fname)
virtual

Check to see if this is a GE pfile. If so, try to open the file for reading. If that works, then return a success code. Return Values: 1 if can read the file, 0 otherwise.

References svkGEPFileReader::InitOffsetsMap(), svkImageReader2::onlyReadHeader, and svkGEPFileReader::ReadGEPFile().

void Deidentify ( )
void ExecuteDataWithInformation ( vtkDataObject *  output,
vtkInformation *  outInfo 
)
protectedvirtual
void ExecuteInformation ( )
protectedvirtual

Side effect of Update() method. Used to load pixel data and initialize vtkImageData Called before ExecuteData()

References svkImageReader2::onlyReadHeader, and svkImageReader2::SetupOutputInformation().

int FillOutputPortInformation ( int  port,
vtkInformation *  info 
)
protectedvirtual

Reimplemented from svkImageReader2.

virtual const char* GetDescriptiveName ( )
inlinevirtual
string GetFileSeriesDescription ( string  fileName)
protectedvirtual
svkDcmHeader::DcmPixelDataFormat GetFileType ( )
protectedvirtual

Returns the file root without extension

Implements svkImageReader2.

References svkDcmHeader::SIGNED_FLOAT_4.

svkGEPFileMapper * GetMapper ( )

returns the mapper

map< string, vector< string > > GetPFMap ( )
virtual svkImageReader2::ReaderType GetReaderType ( )
inlinevirtual

Implements svkImageReader2.

References svkImageReader2::GE_PFILE.

void InitOffsetsMap ( )
protected

Initialize map of field names to dataType, size and offset. This map is used to parse GE Pfile:

// fieldName nativeType numElements offset stringValue // -------------------------------------------------------— // rhr.rh_rdbm_rev , FLOAT_4, 1 , 0 value // rhr.rh_logo , CHAR , 10 , 34 value

References svkGEPFileReader::pfMap, and svkImageReader2::StripWhite().

Referenced by svkGEPFileReader::CanReadFile(), and svkGEPFileReader::ParsePFile().

float LookupRawVersion ( float  rdbmRev,
float  rdbmRevSwapped 
)
static

Lookup version from rdbmRev:

void ModifyRawField ( string  rawField,
string  value 
)
static svkGEPFileReader* New ( )
static
void ParsePFile ( )
protected

Initializes the map of pfile offsets and data types, parses the pfile header and sets the field value in the map to a string representation of the header field.

key pfMap[key][0] pfMap[key][1] pfMap[key][2] pfMap[key][3]

fieldName nativeType numElements offset stringValue

References svkGEPFileReader::InitOffsetsMap(), and svkGEPFileReader::pfMap.

Referenced by svkGEPFileReader::ReadGEPFile().

void PrintHeader ( )

Prints the GE PFile Header to stdout

void PrintShortHeader ( )

Prints the GE PFile Header to stdout

void ReadGEPFile ( )
protected

Read GE Pfile header fields into a string STL map for use during initialization of DICOM header by Init*Module methods.

References svkGEPFileReader::checkSeriesUID, svkImageReader2::GlobFileNames(), and svkGEPFileReader::ParsePFile().

Referenced by svkGEPFileReader::CanReadFile(), svkGEPFileReader::Deidentify(), and svkGEPFileReader::ModifyRawField().

void SetChop ( bool  chop)

Sets the value of chop for the acquisition.

void SetDeidentificationInstanceUID ( string  deidImageUID)

Set the Image InstanceUID to be used for deidentification:

void SetDeidentificationLandmarkUID ( string  deidLandmarkUID)

Set the Landmark UID to be used for deidentification:

void SetDeidentificationSeriesUID ( string  deidSeriesUID)

Set the SeriesInstanceUID to be used for deidentification:

void SetDeidentificationStudyUID ( string  deidStudyUID)

Set the StudyInstanceUID to be used for deidentification:

void SetDeidentify ( svkDcmHeader::PHIType  phiType)

Sets mapper's data deidentification behavior. All PHI fields will be replaced with this value in the loaded DCM header.

void SetDeidentify ( svkDcmHeader::PHIType  phiType,
string  deidentificationId 
)

Sets string to use for identification. All PHI fields will be replaced with this value in the loaded DCM header. See !svkDcmHeader::Deidentify().

void SetDeidentify ( svkDcmHeader::PHIType  phiType,
string  patientId,
string  studyId 
)

Sets string to use for identification. All PHI fields will be replaced with this value in the loaded DCM header. See !svkDcmHeader::Deidentify().

void SetEPSIParams ( svkEPSIReorder::EPSIType  type,
svkEPSIReorder::EPSIAxis  axis,
int  first,
int  numLobes,
int  numSkip 
)
void SetMapperBehavior ( svkGEPFileMapper::MapperBehavior  type)

Sets mapper's data loading behavior.

Referenced by svkGEPFileReader::SetEPSIParams().

void SetProvenance ( )
protectedvirtual
void SetPSDLogic ( string  psdName)
void SetTemperature ( float  temp)

Sets the acquisition temperature in degrees celcius. Used to set the chemcial shift of water for the PPM reference.

vtkTypeMacro ( svkGEPFileReader  ,
svkImageReader2   
)

Member Data Documentation

bool checkSeriesUID
map<string, vector< string > > pfMap
protected

The documentation for this class was generated from the following files: