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

#include <svkDcmtkAdapter.h>

Inheritance diagram for svkDcmtkAdapter:
svkDcmHeader

Public Member Functions

 vtkTypeMacro (svkDcmtkAdapter, svkDcmHeader)
 
- Public Member Functions inherited from svkDcmHeader
 vtkTypeMacro (svkDcmHeader, vtkObject)
 
void MakeDerivedDcmHeader (svkDcmHeader *headerCopy, string seriesDescription)
 
void MakeDerivedDcmHeader (string seriesDescription="")
 
string GetDcmPatientName (string PatientName)
 
void SetDcmPatientName (string PatientName)
 
void SetPixelDataType (DcmPixelDataFormat dataType)
 
int GetPixelDataType (int vtkDataType=svkDcmHeader::UNDEFINED)
 
int GetOrigin (double origin[3], int frameNumber=0)
 
void GetPixelSpacing (double spacing[3])
 
void GetPixelSize (double size[3])
 
void GetOrientation (double orientation[2][3])
 
Orientation GetOrientationType ()
 
int GetOrientationIndex (svkDcmHeader::Orientation orientation)
 
void GetNormalVector (double normal[3])
 
void GetDataDcos (double dcos[3][3], DcmDataOrderingDirection dataSliceOrder=SLICE_ORDER_UNDEFINED)
 
void SetSliceOrder (DcmDataOrderingDirection sliceOrderVal)
 
int GetNumberOfCoils ()
 
int GetNumberOfSlices ()
 
int GetNumberOfTimePoints ()
 
int GetSliceForFrame (int frame)
 
void UpdateNumTimePoints ()
 
void UpdateNumCoils ()
 
int GetDimensionIndexPosition (string indexLabel)
 
string GetDimensionIndexLabel (int dimensionIndexNumber)
 
void AddDimensionIndex (svkDcmHeader::DimensionVector *dimensionVector, svkDcmHeader::DimensionIndexLabel indexType, int maxIndex=0)
 
void RemoveDimensionIndex (svkDcmHeader::DimensionIndexLabel indexType)
 
void SetDimensionIndexSize (svkDcmHeader::DimensionIndexLabel indexType, int maxIndex)
 
DimensionVector GetDimensionIndexVector ()
 
int GetNumberOfFramesInDimension (int dimensionIndex)
 
int GetNumberOfFrames (svkDcmHeader::DimensionVector *dimensionVector)
 
void InitPatientModule (string PatientName, string patientID, string PatientBirthDate, string PatientSex)
 
void InitGeneralStudyModule (string studyDate, string studyTime, string referringPhysiciansName, string studyID, string accessionNumber, string studyInstanceUID)
 
void InitGeneralSeriesModule (string seriesNumber, string seriesDescription, string patientPosition)
 
void InitImagePixelModule (int rows, int columns, svkDcmHeader::DcmPixelDataFormat dataType)
 
void InitImagePlaneModule (string imagePositionPatient, string pixelSpacing="", string imageOrientationPatient="", string sliceThickness="")
 
void InitMRImageModule (string repetitionTime, string echoTime)
 
void InitPlaneOrientationMacro (double dcos[3][3])
 
void InitPlaneOrientationMacro (string orientationString)
 
void InitPixelMeasuresMacro (string pixelSizes, string sliceThickness)
 
void InitMultiFrameDimensionModule (svkDcmHeader::DimensionVector *dimensionVector)
 
void InitPerFrameFunctionalGroupSequence (double toplc[3], double voxelSpacing[3], double dcos[3][3], svkDcmHeader::DimensionVector *dimensionVector)
 
void InitVOILUTModule (float center, float width)
 
void InitPixelValueTransformationMacro (double slope=1.00000, double intercept=0.00000)
 
void InitMRImagingModifierMacro (float transmitFreq, float pixelBandwidth, string magTransfer="NONE", string bloodNulling="NO")
 
void InitVolumeLocalizationSeq (float size[3], float center[3], float dcos[3][3])
 
void InitMRTimingAndRelatedParametersMacro (float tr=UNKNOWN_TIME, float flipAngle=-999, int numEchoes=1)
 
void InitMREchoMacro (float TE=UNKNOWN_TIME)
 
void InitMRModifierMacro (float inversionTime=UNKNOWN_TIME)
 
void InitMRTransmitCoilMacro (string coilMfg="UNKNOWN", string coilName="UNKNOWN", string coilType="UNKNOWN")
 
void InitMRAveragesMacro (int numAverages=1)
 
void InitRawDataModule (string contentDate, string contentTime, void *rawFile)
 
int InitDerivedMRIHeader (svkDcmHeader *mri, vtkIdType dataType, string seriesDescription)
 
int ConvertEnhancedMriToMriHeader (svkDcmHeader *mri, vtkIdType dataType)
 
void Deidentify (PHIType phiType)
 
void Deidentify (PHIType phiType, string id)
 
void Deidentify (PHIType phyType, string patientId, string studyId)
 
void Redimension (svkDcmHeader::DimensionVector *dimensionVector)
 
void Redimension (svkDcmHeader::DimensionVector *dimensionVector, double *newToplcOrigin, double *newPixelSpacing)
 

Static Public Member Functions

static svkDcmtkAdapterNew ()
 
- Static Public Member Functions inherited from svkDcmHeader
static int GetNumberOfDimensionIndices (int numTimePts, int numCoils)
 
static void SetDimensionIndices (unsigned int *indexValues, int numFrameIndices, int sliceNum, int timePt, int coilNum, int numTimePts, int numCoils)
 
static void PrintDimensionIndexVector (svkDcmHeader::DimensionVector *dimensionVector)
 
static void SwapDimensionIndexLabels (svkDcmHeader::DimensionVector *dimensionVector, svkDcmHeader::DimensionIndexLabel label1, svkDcmHeader::DimensionIndexLabel label2)
 
static DimensionIndexLabel StringToDimensionIndexLabel (string dimensionIndexLabelString)
 
static string DimensionIndexLabelToString (svkDcmHeader::DimensionIndexLabel label)
 
static DimensionIndexLabel GetDimensionLabelFromIndex (svkDcmHeader::DimensionVector *dimensionVector, int index)
 
static int GetDimensionVectorValue (svkDcmHeader::DimensionVector *dimensionVector, svkDcmHeader::DimensionIndexLabel dimensionLabel)
 
static int GetDimensionVectorValue (svkDcmHeader::DimensionVector *dimensionVector, int index)
 
static void SetDimensionVectorValue (svkDcmHeader::DimensionVector *dimensionVector, int index, int value)
 
static void SetDimensionVectorValue (svkDcmHeader::DimensionVector *dimensionVector, svkDcmHeader::DimensionIndexLabel indexType, int value)
 
static bool IsDimensionDefined (svkDcmHeader::DimensionVector *dimensionVector, svkDcmHeader::DimensionIndexLabel indexType)
 
static void GetDimensionVectorIndexFromFrame (svkDcmHeader::DimensionVector *dimensionVector, svkDcmHeader::DimensionVector *loopIndex, int frame)
 
static void GetDimensionVectorIndexFromCellID (svkDcmHeader::DimensionVector *dimensionVector, svkDcmHeader::DimensionVector *loopIndex, int cellID)
 
static int GetCellIDFromDimensionVectorIndex (svkDcmHeader::DimensionVector *dimensionVector, svkDcmHeader::DimensionVector *loopIndex)
 
static int GetSpatialCellIDFromDimensionVectorIndex (svkDcmHeader::DimensionVector *dimensionVector, svkDcmHeader::DimensionVector *loopIndex)
 
static int GetNumberOfCells (svkDcmHeader::DimensionVector *dimensionVector)
 
static long int GetPixelDataOffset (string fileName)
 
static short GetPixelValueAsShort (long int offsetToPixelData, long int pixelIndex, string fileName)
 
static bool IsFileDICOM (string fname)
 
static
svkDcmHeader::DcmPixelDataFormat 
GetVtkDataTypeFromSvkDataType (vtkIdType vtkType)
 
static void GetCenterFromOrigin (double origin[3], int numVoxels[3], double voxelSpacing[3], double dcos[3][3], double center[3])
 
static void GetCenterFromOrigin (svkDcmHeader *hdr, double center[3])
 
static void GetOriginFromCenter (double center[3], int numVoxels[3], double voxelSpacing[3], double dcos[3][3], double origin[3])
 
static void GetSpatialDimensions (svkDcmHeader::DimensionVector *dimensionVector, int *numVoxels)
 
static int GetNumSpatialVoxels (svkDcmHeader::DimensionVector *dimensionVector)
 

Protected Member Functions

 svkDcmtkAdapter ()
 
 ~svkDcmtkAdapter ()
 
virtual void CreateIOD (DcmIodType iodType)
 
virtual void SetSOPClassUID (DcmIodType iodType)
 
virtual void PrintDcmHeader ()
 
virtual void PrintDcmHeader (ostream &os)
 
virtual void InsertEmptyElement (const char *name)
 
virtual void InsertUniqueUID (const char *name)
 
string GenerateUniqueUID ()
 
virtual void SetValue (const char *name, int value)
 
virtual void SetValue (const char *name, float value)
 
virtual void SetValue (const char *name, double value)
 
virtual void SetValue (const char *name, string value, bool setMetaInfo=false)
 
virtual void SetValue (const char *name, unsigned char *values, int numValues)
 
virtual void SetValue (const char *name, unsigned short *values, int numValues)
 
virtual void SetValue (const char *name, signed short *values, int numValues)
 
virtual void SetValue (const char *name, float *values, int numValues)
 
virtual void ModifyValueRecursive (const char *name, string value)
 
virtual void GetByteValue (const char *name, char *values, long unsigned int numValues)
 
virtual void GetShortValue (const char *name, short *values, long unsigned int numValues)
 
virtual unsigned short GetShortValue (const char *name, long unsigned int position)
 
virtual unsigned short GetPixelValue (long unsigned int position)
 
virtual int GetIntValue (const char *name)
 
virtual float GetFloatValue (const char *name)
 
virtual void GetFloatValue (const char *name, float *values, long unsigned int numValues)
 
virtual double GetDoubleValue (const char *name)
 
virtual string GetStringValue (const char *name)
 
virtual string GetStringValue (const char *name, int pos)
 
virtual void AddSequenceItemElement (const char *parentSeqName, int parentSeqItemPosition, const char *elementName)
 
virtual void AddSequenceItemElement (const char *seqName, int seqItemPosition, const char *elementName, string value, const char *parentSeqName=NULL, int parentSeqItemPosition=0)
 
virtual void AddSequenceItemElement (const char *seqName, int seqItemPosition, const char *elementName, char *values, int numValues, const char *parentSeqName=NULL, int parentSeqItemPosition=0)
 
virtual void AddSequenceItemElement (const char *seqName, int seqItemPosition, const char *elementName, unsigned short *values, int numValues, const char *parentSeqName=NULL, int parentSeqItemPosition=0)
 
virtual void AddSequenceItemElement (const char *seqName, int seqItemPosition, const char *elementName, unsigned int *values, int numValues, const char *parentSeqName=NULL, int parentSeqItemPosition=0)
 
virtual void AddSequenceItemElement (const char *seqName, int seqItemPosition, const char *elementName, float *values, unsigned long int numValues, const char *parentSeqName=NULL, int parentSeqItemPosition=0)
 
virtual void AddSequenceItemElement (const char *seqName, int seqItemPosition, const char *elementName, int value, const char *parentSeqName=NULL, int parentSeqItemPosition=0)
 
virtual void AddSequenceItemElement (const char *seqName, int seqItemPosition, const char *elementName, long int value, const char *parentSeqName=NULL, int parentSeqItemPosition=0)
 
virtual void AddSequenceItemElement (const char *seqName, int seqItemPosition, const char *elementName, float value, const char *parentSeqName=NULL, int parentSeqItemPosition=0)
 
virtual void AddSequenceItemElement (const char *seqName, int seqItemPosition, const char *elementName, double value, const char *parentSeqName=NULL, int parentSeqItemPosition=0)
 
virtual int GetSequenceItemElementLength (const char *seqName, int seqItemPosition, const char *elementName, const char *parentSeqName, int parentSeqItemPosition)
 
virtual void CopySequence (svkDcmHeader *target, const char *seqName)
 
virtual void ClearSequence (const char *seqName)
 
virtual void ClearElement (const char *elementName)
 
virtual void RemoveElement (const char *elementName)
 
virtual int GetIntSequenceItemElement (const char *seqName, int seqItemPosition, const char *elementName, const char *parentSeqName=NULL, int parentSeqItemPosition=0, int pos=0)
 
virtual long int GetLongIntSequenceItemElement (const char *seqName, int seqItemPosition, const char *elementName, const char *parentSeqName=NULL, int parentSeqItemPosition=0, int pos=0)
 
virtual float GetFloatSequenceItemElement (const char *seqName, int seqItemPosition, const char *elementName, const char *parentSeqName=NULL, int parentSeqItemPosition=0, int pos=0)
 
virtual void GetFloatSequenceItemElement (const char *seqName, int seqItemPosition, const char *elementName, float *values, int numValues, const char *parentSeqName=NULL, int parentSeqItemPosition=0)
 
virtual double GetDoubleSequenceItemElement (const char *seqName, int seqItemPosition, const char *elementName, const char *parentSeqName=NULL, int parentSeqItemPosition=0)
 
virtual string GetStringSequenceItemElement (const char *seqName, int seqItemPosition, const char *elementName, const char *parentSeqName=NULL, int parentSeqItemPosition=0)
 
virtual string GetStringSequenceItemElement (const char *seqName, int seqItemPosition, const char *elementName, int pos, const char *parentSeqName=NULL, int parentSeqItemPosition=0)
 
virtual int GetNumberOfElements (const char *elementName)
 
virtual int GetNumberOfItemsInSequence (const char *seqName)
 
virtual int GetNumberOfItemsInSequence (const char *seqName, const char *parentSeqName, int parentSeqItemPosition)
 
virtual void WriteDcmFile (string fileName)
 
virtual void WriteDcmFileCompressed (string fileName)
 
virtual int ReadDcmFile (string fileName, unsigned int maxLength)
 
virtual int ReadDcmFileHeaderOnly (string fileName)
 
virtual int GetOriginalXFerSyntax ()
 
virtual void CopyDcmHeader (svkDcmHeader *headerCopy)
 
virtual bool ElementExists (const char *elementName, const char *parentSeqName)
 
virtual void ReplaceOldElements (bool replaceElements)
 
virtual void HandleTagNotFoundException (const svkTagNotFound &e)
 
virtual string GetDcmNameFromTag (string groupElementString)
 
- Protected Member Functions inherited from svkDcmHeader
 svkDcmHeader ()
 
 ~svkDcmHeader ()
 
bool WasModified ()
 

Additional Inherited Members

- Public Types inherited from svkDcmHeader
enum  DcmIodType {
  MR_IMAGE = 0, ENHANCED_MR_IMAGE, MR_SPECTROSCOPY, SECONDARY_CAPTURE,
  MULTI_FRAME_BYTE_SC, MULTI_FRAME_WORD_SC, RAW_DATA
}
 
enum  { DCMTK_API = 0 }
 
enum  DcmPixelDataFormat {
  UNDEFINED = -1, UNSIGNED_INT_1 = 0, UNSIGNED_INT_2, SIGNED_INT_2,
  SIGNED_FLOAT_4, SIGNED_FLOAT_8
}
 
enum  Orientation { UNKNOWN_ORIENTATION = -1, AXIAL = 0, CORONAL, SAGITTAL }
 
enum  DcmDataOrderingDirection { SLICE_ORDER_UNDEFINED = -1, INCREMENT_ALONG_POS_NORMAL = 0, INCREMENT_ALONG_NEG_NORMAL = 1 }
 
enum  PHIType { PHI_IDENTIFIED = 0, PHI_LIMITED, PHI_DEIDENTIFIED }
 
enum  DimensionIndexLabel {
  COL_INDEX = -2, ROW_INDEX = -1, SLICE_INDEX = 0, TIME_INDEX = 1,
  CHANNEL_INDEX = 2, EPSI_ACQ_INDEX = 3
}
 
typedef vector< map
< svkDcmHeader::DimensionIndexLabel,
int > > 
DimensionVector
 
- Static Public Attributes inherited from svkDcmHeader
static const float UNKNOWN_TIME = -1
 
static const string UNKNOWN_STRING = "UNKNOWN"
 

Detailed Description

Adapter Class to make a DCMTK DcmFileFormat look like a generic svkDcmHeader object.

Constructor & Destructor Documentation

svkDcmtkAdapter ( )
protected

Constructor.

~svkDcmtkAdapter ( )
protected

Destructor.

Member Function Documentation

void AddSequenceItemElement ( const char *  parentSeqName,
int  parentSeqItemPosition,
const char *  elementName 
)
protectedvirtual

Add the nested sequence within the specified item of the parent sequence.

Parameters
parentSeqNamethe string name of the parent sequence
parentSeqItemPositionthe position of the item in that sequence
elementNamethe string name of the item in the sequence

Implements svkDcmHeader.

void AddSequenceItemElement ( const char *  seqName,
int  seqItemPosition,
const char *  elementName,
string  value,
const char *  parentSeqName = NULL,
int  parentSeqItemPosition = 0 
)
protectedvirtual

Add an item to the specified item in the specified sequence(seqName), where the nestedSequence is nested within a specific parent sequence(parentSeqName) and item(parentSeqItemPosition).

Parameters
seqNamethe string name of the parent sequence
seqItemPositionthe position of the item in that sequence
elementNamethe name of the element being added to the specified item
valuethe value of the element being added to the specified item ("EMPTY_ELEMENT") inserts an empty element.
parentSeqNamethe string name of the parent sequence
parentSeqItemPositionthe position of the item in that sequence

Implements svkDcmHeader.

References svkDcmtkUtils::setValue().

void AddSequenceItemElement ( const char *  seqName,
int  seqItemPosition,
const char *  elementName,
char *  values,
int  numValues,
const char *  parentSeqName = NULL,
int  parentSeqItemPosition = 0 
)
protectedvirtual

Add an item to the specified item in the specified sequence(seqName), where the sequence is nested within a specific parent sequence(parentSeqName) and item(parentSeqItemPosition).

Parameters
seqNamethe string name of the parent sequence
seqItemPositionthe position of the item in that sequence
elementNamethe name of the element being added to the specified item
valuesarray of value of the element being added to the specified item
numValuesnumber of values in values array.
parentSeqNamethe string name of the parent sequence
parentSeqItemPositionthe position of the item in that sequence

Implements svkDcmHeader.

void AddSequenceItemElement ( const char *  seqName,
int  seqItemPosition,
const char *  elementName,
unsigned short *  values,
int  numValues,
const char *  parentSeqName = NULL,
int  parentSeqItemPosition = 0 
)
protectedvirtual

Add an item to the specified item in the specified sequence(seqName), where the sequence is nested within a specific parent sequence(parentSeqName) and item(parentSeqItemPosition).

Parameters
seqNamethe string name of the parent sequence
seqItemPositionthe position of the item in that sequence
elementNamethe name of the element being added to the specified item
valuesarray of value of the element being added to the specified item
numValuesnumber of values in values array.
parentSeqNamethe string name of the parent sequence
parentSeqItemPositionthe position of the item in that sequence

Implements svkDcmHeader.

void AddSequenceItemElement ( const char *  seqName,
int  seqItemPosition,
const char *  elementName,
unsigned int *  values,
int  numValues,
const char *  parentSeqName = NULL,
int  parentSeqItemPosition = 0 
)
protectedvirtual

Add an item to the specified item in the specified sequence(seqName), where the sequence is nested within a specific parent sequence(parentSeqName) and item(parentSeqItemPosition).

Parameters
seqNamethe string name of the parent sequence
seqItemPositionthe position of the item in that sequence
elementNamethe name of the element being added to the specified item
valuesarray of value of the element being added to the specified item
numValuesnumber of values in values array.
parentSeqNamethe string name of the parent sequence
parentSeqItemPositionthe position of the item in that sequence

Implements svkDcmHeader.

void AddSequenceItemElement ( const char *  seqName,
int  seqItemPosition,
const char *  elementName,
float *  values,
unsigned long int  numValues,
const char *  parentSeqName = NULL,
int  parentSeqItemPosition = 0 
)
protectedvirtual

Add an item to the specified item in the specified sequence(seqName), where the sequence is nested within a specific parent sequence(parentSeqName) and item(parentSeqItemPosition).

Parameters
seqNamethe string name of the parent sequence
seqItemPositionthe position of the item in that sequence
elementNamethe name of the element being added to the specified item
valuesarray of value of the element being added to the specified item
numValuesnumber of values in values array.
parentSeqNamethe string name of the parent sequence
parentSeqItemPositionthe position of the item in that sequence

Implements svkDcmHeader.

void AddSequenceItemElement ( const char *  seqName,
int  seqItemPosition,
const char *  elementName,
int  value,
const char *  parentSeqName = NULL,
int  parentSeqItemPosition = 0 
)
protectedvirtual

Add an item to the specified item in the specified sequence(seqName), where the sequence is nested within a specific parent sequence(parentSeqName) and item(parentSeqItemPosition).

Parameters
seqNamethe string name of the parent sequence
seqItemPositionthe position of the item in that sequence
elementNamethe name of the element being added to the specified item
valuethe value of the element being added to the specified item
parentSeqNamethe string name of the parent sequence
parentSeqItemPositionthe position of the item in that sequence

Implements svkDcmHeader.

References svkDcmtkUtils::setValue().

void AddSequenceItemElement ( const char *  seqName,
int  seqItemPosition,
const char *  elementName,
long int  value,
const char *  parentSeqName = NULL,
int  parentSeqItemPosition = 0 
)
protectedvirtual

Add an item to the specified item in the specified sequence(seqName), where the sequence is nested within a specific parent sequence(parentSeqName) and item(parentSeqItemPosition).

Parameters
seqNamethe string name of the parent sequence
seqItemPositionthe position of the item in that sequence
elementNamethe name of the element being added to the specified item
valuethe value of the element being added to the specified item
parentSeqNamethe string name of the parent sequence
parentSeqItemPositionthe position of the item in that sequence

Implements svkDcmHeader.

References svkDcmtkUtils::setValue().

void AddSequenceItemElement ( const char *  seqName,
int  seqItemPosition,
const char *  elementName,
float  value,
const char *  parentSeqName = NULL,
int  parentSeqItemPosition = 0 
)
protectedvirtual

Add an item to the specified item in the specified sequence(seqName), where the nestedSequence is nested within a specific parent sequence(parentSeqName) and item(parentSeqItemPosition).

Parameters
seqNamethe string name of the parent sequence
seqItemPositionthe position of the item in that sequence
elementNamethe name of the element being added to the specified item
valuethe value of the element being added to the specified item
parentSeqNamethe string name of the parent sequence
parentSeqItemPositionthe position of the item in that sequence

Implements svkDcmHeader.

References svkDcmtkUtils::setValue().

void AddSequenceItemElement ( const char *  seqName,
int  seqItemPosition,
const char *  elementName,
double  value,
const char *  parentSeqName = NULL,
int  parentSeqItemPosition = 0 
)
protectedvirtual

Add an item to the specified item in the specified sequence(seqName), where the nestedSequence is nested within a specific parent sequence(parentSeqName) and item(parentSeqItemPosition).

Parameters
seqNamethe string name of the parent sequence
seqItemPositionthe position of the item in that sequence
elementNamethe name of the element being added to the specified item
valuethe value of the element being added to the specified item
parentSeqNamethe string name of the parent sequence
parentSeqItemPositionthe position of the item in that sequence

Implements svkDcmHeader.

References svkDcmtkUtils::setValue().

void ClearElement ( const char *  elementName)
protectedvirtual

Clears the specified element

Parameters
seqNamethe string name of the parent sequence to clear

Implements svkDcmHeader.

void ClearSequence ( const char *  seqName)
protectedvirtual

Removes all items from the specified sequence

Parameters
seqNamethe string name of the parent sequence to clear

Implements svkDcmHeader.

void CopyDcmHeader ( svkDcmHeader headerCopy)
protectedvirtual

Copies the current DICOM header to the headerCopy, generating new series and instance UIDs, but retaining the reference header studyUID. VTK doesn't support copy constructors, so this is a method.

Parameters
headerCopyheader object to copy current object into.

Implements svkDcmHeader.

void CopySequence ( svkDcmHeader target,
const char *  seqName 
)
protectedvirtual

Copies a top-level sequence from this header to the target header.

Implements svkDcmHeader.

void CreateIOD ( DcmIodType  iodType)
protectedvirtual

Factory method implementation

Implements svkDcmHeader.

bool ElementExists ( const char *  elementName,
const char *  parentSeqName 
)
protectedvirtual

Test for existence of a particular element. If patentSeqName is set to "top" then only check top level attributes (i.e. searchIntoSub = false).

Implements svkDcmHeader.

string GenerateUniqueUID ( )
protectedvirtual

Static utility method to generate a new unique DICOM UID.

Implements svkDcmHeader.

Referenced by svkDcmtkAdapter::InsertUniqueUID().

void GetByteValue ( const char *  name,
char *  values,
long unsigned int  numValues 
)
protectedvirtual

Gets the array of values for a given tag.

Parameters
namethe name of the tag whose value you wish to set
valuesthe pointer to the array of values you wish the tag to have
numValuesthe number of elements in the array of values

Implements svkDcmHeader.

string GetDcmNameFromTag ( string  groupElementString)
protectedvirtual

Lookup a name from a group/element Args: groupElementString "(gggg,eeee)"

Implements svkDcmHeader.

double GetDoubleSequenceItemElement ( const char *  seqName,
int  seqItemPosition,
const char *  elementName,
const char *  parentSeqName = NULL,
int  parentSeqItemPosition = 0 
)
protectedvirtual

Get an item from the specified item in the specified sequence.

Parameters
seqNamethe string name of the sequence
itemPositionthe position of the item in that sequence
elementNamethe name of the element being added to the specified item
Returns
double value of the item element

Implements svkDcmHeader.

References svkDcmtkUtils::getDoubleValue().

double GetDoubleValue ( const char *  name)
protectedvirtual

Gets the value of a given tag as a double.

Parameters
namethe name of the tag whose value you wish to get
Returns
the double value of the tag

Implements svkDcmHeader.

References svkDcmtkIod::getDoubleValue().

float GetFloatSequenceItemElement ( const char *  seqName,
int  seqItemPosition,
const char *  elementName,
const char *  parentSeqName = NULL,
int  parentSeqItemPosition = 0,
int  pos = 0 
)
protectedvirtual

Get an item from the specified item in the specified sequence.

Parameters
seqNamethe string name of the sequence
itemPositionthe position of the item in that sequence
elementNamethe name of the element being added to the specified item
Returns
float value of the item element

Implements svkDcmHeader.

References svkDcmtkUtils::getFloatValue().

void GetFloatSequenceItemElement ( const char *  seqName,
int  seqItemPosition,
const char *  elementName,
float *  values,
int  numValues,
const char *  parentSeqName = NULL,
int  parentSeqItemPosition = 0 
)
protectedvirtual

Get an item from the specified item in the specified sequence.

Parameters
seqNamethe string name of the sequence
itemPositionthe position of the item in that sequence
elementNamethe name of the element being added to the specified item
Returns
array of float values for the item element

Implements svkDcmHeader.

float GetFloatValue ( const char *  name)
protectedvirtual

Gets the value of a given tag as a float.

Parameters
namethe name of the tag whose value you wish to get
Returns
the float value of the tag

Implements svkDcmHeader.

References svkDcmtkIod::getFloatValue().

void GetFloatValue ( const char *  name,
float *  values,
long unsigned int  numValues 
)
protectedvirtual

Gets the array of values for a given tag.

Parameters
namethe name of the tag whose value you wish to set
valuesthe pointer to the array of values you wish the tag to have
numValuesthe number of elements in the array of values

Implements svkDcmHeader.

int GetIntSequenceItemElement ( const char *  seqName,
int  seqItemPosition,
const char *  elementName,
const char *  parentSeqName = NULL,
int  parentSeqItemPosition = 0,
int  pos = 0 
)
protectedvirtual

Get an item from the specified item in the specified sequence.

Parameters
seqNamethe string name of the sequence
itemPositionthe position of the item in that sequence
elementNamethe name of the element being added to the specified item
Returns
integer value of the item element

Implements svkDcmHeader.

References svkDcmtkUtils::getIntValue().

int GetIntValue ( const char *  name)
protectedvirtual

Gets the value of a given tag as an integer.

Parameters
namethe name of the tag whose value you wish to get
Returns
the integer value of the tag

Implements svkDcmHeader.

References svkDcmtkIod::getIntValue().

long int GetLongIntSequenceItemElement ( const char *  seqName,
int  seqItemPosition,
const char *  elementName,
const char *  parentSeqName = NULL,
int  parentSeqItemPosition = 0,
int  pos = 0 
)
protectedvirtual

Get an item from the specified item in the specified sequence.

Parameters
seqNamethe string name of the sequence
itemPositionthe position of the item in that sequence
elementNamethe name of the element being added to the specified item
Returns
integer value of the item element

Implements svkDcmHeader.

References svkDcmtkUtils::getStringValue(), and svkTypeUtils::StringToLInt().

int GetNumberOfElements ( const char *  elementName)
protectedvirtual

Returns the number of elements in the data set with the specified element name.

Parameters
elementNamethe name of the tag you wish to know the number of elements in
Returns
the number of elements in the given tag

Implements svkDcmHeader.

int GetNumberOfItemsInSequence ( const char *  seqName)
protectedvirtual

Returns the number of items in the specified sequence.

Parameters
seqNamethe name of the sequence you wish to know the number of elements in
Returns
the number of elements in the given sequence

Implements svkDcmHeader.

int GetNumberOfItemsInSequence ( const char *  seqName,
const char *  parentSeqName,
int  parentSeqItemPosition 
)
protectedvirtual

Returns the number of items in the specified sequence.

Parameters
seqNamethe name of the sequence you wish to know the number of elements in
Returns
the number of elements in the given sequence

Implements svkDcmHeader.

int GetOriginalXFerSyntax ( )
protectedvirtual

Return the original transfer syntax of the data set.

Implements svkDcmHeader.

unsigned short GetPixelValue ( long unsigned int  position)
protectedvirtual

Return one short word at the specified index from the PixelData field.

Implements svkDcmHeader.

int GetSequenceItemElementLength ( const char *  seqName,
int  seqItemPosition,
const char *  elementName,
const char *  parentSeqName,
int  parentSeqItemPosition 
)
protectedvirtual

Returns the length of the element

Parameters
elementNamethe name of the tag you wish to know the number of elements in
Returns
the length of elements in the given tag

Implements svkDcmHeader.

void GetShortValue ( const char *  name,
short *  values,
long unsigned int  numValues 
)
protectedvirtual

Gets the array of values for a given tag.

Parameters
namethe name of the tag whose value you wish to set
valuesthe pointer to the array of values you wish the tag to have
numValuesthe number of elements in the array of values

Implements svkDcmHeader.

unsigned short GetShortValue ( const char *  name,
long unsigned int  position 
)
protectedvirtual

Gets the value at a given position for a given tag.

Parameters
namethe name of the tag whose value you wish to set
positionthe position in the array of the value

Implements svkDcmHeader.

string GetStringSequenceItemElement ( const char *  seqName,
int  seqItemPosition,
const char *  elementName,
const char *  parentSeqName = NULL,
int  parentSeqItemPosition = 0 
)
protectedvirtual

Get an item from the specified item in the specified sequence.

Parameters
seqNamethe string name of the sequence
itemPositionthe position of the item in that sequence
elementNamethe name of the element being added to the specified item
Returns
string value of the item element

Implements svkDcmHeader.

References svkDcmtkUtils::getStringValue().

string GetStringSequenceItemElement ( const char *  seqName,
int  seqItemPosition,
const char *  elementName,
int  pos,
const char *  parentSeqName = NULL,
int  parentSeqItemPosition = 0 
)
protectedvirtual

Get an item from the specified item in the specified sequence.

Parameters
seqNamethe string name of the sequence
itemPositionthe position of the item in that sequence
elementNamethe name of the element being added to the specified item
posthe position within the element
Returns
integer value of the item element

Implements svkDcmHeader.

References svkDcmtkUtils::getStringValue().

string GetStringValue ( const char *  name)
protectedvirtual

Gets the value of a given tag as a string.

Parameters
namethe name of the tag whose value you wish to get
Returns
the string value of the tag

Implements svkDcmHeader.

References svkDcmtkIod::getStringValue(), and svkDcmtkAdapter::HandleTagNotFoundException().

string GetStringValue ( const char *  name,
int  pos 
)
protectedvirtual

Gets the value of a given tag, for a given position as a string.

Parameters
namethe name of the tag whose value you wish to get
posthe position of the element in the string whose value you wish to get
Returns
the string value of the tag, for the given position

Implements svkDcmHeader.

References svkDcmtkIod::getStringValue(), and svkDcmtkAdapter::HandleTagNotFoundException().

void HandleTagNotFoundException ( const svkTagNotFound e)
protectedvirtual

Some exceptions are acceptable so lets filter those out. If in debug mode report all exceptions.

Referenced by svkDcmtkAdapter::GetStringValue().

void InsertEmptyElement ( const char *  name)
protectedvirtual

Sets the value of a given tag.

Parameters
namethe name of the tag whose value you wish to set
valuethe integer value you wish the tag to have

Implements svkDcmHeader.

void InsertUniqueUID ( const char *  name)
protectedvirtual

Generate and insert a unique UID as the value of the specified tag.

Parameters
namethe name of the tag whose value you wish to set
whetherto set the UID in the dataset or meta information.

Implements svkDcmHeader.

References svkDcmtkAdapter::GenerateUniqueUID(), and svkDcmtkIod::setValue().

void ModifyValueRecursive ( const char *  name,
string  value 
)
protectedvirtual

Sets the array of value for a given tag.

Parameters
namethe name of the tag whose value you wish to set
valuesthe pointer to the array of values you wish the tag to have
numValuesthe number of elements in the array of values

Implements svkDcmHeader.

static svkDcmtkAdapter* New ( )
static
void PrintDcmHeader ( )
protectedvirtual

Print the header information to standard out.

Implements svkDcmHeader.

void PrintDcmHeader ( ostream &  os)
protectedvirtual

Print the header information to standard the given stream.

Implements svkDcmHeader.

int ReadDcmFile ( string  fileName,
unsigned int  maxLength 
)
protectedvirtual

Read the DICOM file to the specified file name

Parameters
fileNamename of the output file root (no extension).

Implements svkDcmHeader.

References HEADER_MAX_READ_LENGTH.

Referenced by svkDcmtkAdapter::ReadDcmFileHeaderOnly().

int ReadDcmFileHeaderOnly ( string  fileName)
protectedvirtual

Read the DICOM header only to the specified file name

Parameters
fileNamename of the output file root (no extension).

Implements svkDcmHeader.

References HEADER_MAX_READ_LENGTH, and svkDcmtkAdapter::ReadDcmFile().

void RemoveElement ( const char *  elementName)
protectedvirtual

Removes the specified element

Parameters
seqNamethe string name of the element to remove

Implements svkDcmHeader.

void ReplaceOldElements ( bool  replaceOldElements)
protectedvirtual

determines whether insert new element statements replace existing values or not.

Implements svkDcmHeader.

void SetSOPClassUID ( DcmIodType  iodType)
protectedvirtual
void SetValue ( const char *  name,
int  value 
)
protectedvirtual

Sets the value of a given tag.

Parameters
namethe name of the tag whose value you wish to set
valuethe integer value you wish the tag to have

Implements svkDcmHeader.

References svkDcmtkIod::setValue().

void SetValue ( const char *  name,
float  value 
)
protectedvirtual

Sets the value of a given tag.

Parameters
namethe name of the tag whose value you wish to set
valuethe float value you wish the tag to have

Implements svkDcmHeader.

References svkDcmtkIod::setValue().

void SetValue ( const char *  name,
double  value 
)
protectedvirtual

Sets the value of a given tag.

Parameters
namethe name of the tag whose value you wish to set
valuethe double value you wish the tag to have

Implements svkDcmHeader.

References svkDcmtkIod::setValue().

void SetValue ( const char *  name,
string  value,
bool  setMetaInfo = false 
)
protectedvirtual

Sets the value of a given tag.

Parameters
namethe name of the tag whose value you wish to set
valuethe string value you wish the tag to have
whetherto set the value in the dataset or metaInfo

Implements svkDcmHeader.

References svkDcmtkIod::setValue().

void SetValue ( const char *  name,
unsigned char *  values,
int  numValues 
)
protectedvirtual

Sets the array of value for a given tag.

Parameters
namethe name of the tag whose value you wish to set
valuesthe pointer to the array of values you wish the tag to have
numValuesthe number of elements in the array of values

Implements svkDcmHeader.

void SetValue ( const char *  name,
unsigned short *  values,
int  numValues 
)
protectedvirtual

Sets the array of value for a given tag.

Parameters
namethe name of the tag whose value you wish to set
valuesthe pointer to the array of values you wish the tag to have
numValuesthe number of elements in the array of values

Implements svkDcmHeader.

virtual void SetValue ( const char *  name,
signed short *  values,
int  numValues 
)
protectedvirtual

Sets the array of value for a given tag.

Parameters
namethe name of the tag whose value you wish to set
valuesthe pointer to the array of values you wish the tag to have
numValuesthe number of elements in the array of values

Implements svkDcmHeader.

void SetValue ( const char *  name,
float *  values,
int  numValues 
)
protectedvirtual

Sets the array of value for a given tag.

Parameters
namethe name of the tag whose value you wish to set
valuesthe pointer to the array of values you wish the tag to have
numValuesthe number of elements in the array of values

Implements svkDcmHeader.

vtkTypeMacro ( svkDcmtkAdapter  ,
svkDcmHeader   
)
void WriteDcmFile ( string  fileName)
protectedvirtual

Writes the DICOM file to the specified file name

Parameters
fileNamename of the output file root (no extension).

Implements svkDcmHeader.

void WriteDcmFileCompressed ( string  fileName)
protectedvirtual

Writes the DICOM file to the specified file name and using RLE Lossless compression transfer syntax.

Parameters
fileNamename of the output file root (no extension).

Implements svkDcmHeader.


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