Program: gdcm
Module: $RCSfile: gdcmFile.cxx,v $
Language: C++
- Date: $Date: 2006/03/01 10:15:12 $
- Version: $Revision: 1.316 $
+ Date: $Date: 2006/03/29 16:13:00 $
+ Version: $Revision: 1.317 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
GrPixel = 0x7fe0; // to avoid further troubles
NumPixel = 0x0010;
BasicOffsetTableItemValue = 0;
+ FourthDimensionLocation = TagKey(0,0);
}
}
return true;
}
+
/**
* \brief This predicate, based on hopefully reasonable heuristics,
* decides whether or not the current File was properly parsed
return 1;
}
+/**
+ * \brief Retrieve the -unnormalized- number of 'times' of '4D image'.
+ * User has to tell gdcm the location of this '4th Dimension component'
+ * using SetFourthDimensionLocation() method before.
+ * \warning The defaulted value is 1.
+ * @return The encountered size when found, 1 by default
+ * (The file doesn't contain a '4D image'.).
+ */
+int File::GetTSize()
+{
+ if (FourthDimensionLocation == TagKey(0,0) )// 4D location is not set : not a 4D object
+ return 1;
+
+ DataEntry *entry = GetDataEntry(FourthDimensionLocation.GetGroup(),
+ FourthDimensionLocation.GetElement() );
+ if( !entry )
+ {
+ gdcmWarningMacro( " FourthDimensionLocation not found at : " <<
+ std::hex << FourthDimensionLocation.GetGroup()
+ << "|" << FourthDimensionLocation.GetElement());
+ return 1;
+ }
+ else
+ {
+ return (int)entry->GetValue(0);
+ }
+}
+
/**
* \brief gets the info from 0018,1164 : ImagerPixelSpacing
* then 0028,0030 : Pixel Spacing
{
gdcmWarningMacro( "Unfound Pixel Spacing (0028,0030)" );
}
-
return xspacing;
}
Program: gdcm
Module: $RCSfile: gdcmFile.h,v $
Language: C++
- Date: $Date: 2006/02/16 20:06:14 $
- Version: $Revision: 1.124 $
+ Date: $Date: 2006/03/29 16:13:00 $
+ Version: $Revision: 1.125 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmDebug.h"
#include "gdcmDocument.h"
-
+#include "gdcmTagKey.h"
namespace gdcm
bool Load();
// Standard values and informations contained in the header
bool IsReadable();
+
+ void SetFourthDimensionLocation(uint16_t group, uint16_t elem) {
+ FourthDimensionLocation = TagKey(group, elem); }
// Some heuristic based accessors, end user intended
int GetImageNumber();
int GetXSize();
int GetYSize();
int GetZSize();
-
+ int GetTSize(); // unnormalized in DICOM V3
+
float GetXSpacing();
float GetYSpacing();
float GetZSpacing();
/// In order to make things easier the parser shall store the proper value
/// in GrPixel to provide a unique access facility.
uint16_t GrPixel;
+ /// \brief allows user to tell gdcm in which DataElement is stored
+ ///the -unnormalized- 4th Dimension
+ TagKey FourthDimensionLocation;
private:
bool DoTheLoadingJob();