Program: gdcm
Module: $RCSfile: gdcmHeader.cxx,v $
Language: C++
- Date: $Date: 2004/06/22 14:18:49 $
- Version: $Revision: 1.167 $
+ Date: $Date: 2004/06/23 09:30:22 $
+ Version: $Revision: 1.169 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
bool enable_sequences,
bool ignore_shadow):
gdcmDocument(filename,exception_on_error,enable_sequences,ignore_shadow)
-{
-/*
- typedef struct {
- guint32 totalSQlength;
- guint32 alreadyParsedlength;
- } pileElem;
-*/
-
+{
// for some ACR-NEMA images GrPixel, NumPixel is *not* 7fe0,0010
// We may encounter the 'RETired' (0x0028, 0x0200) tag
// (Image Location") . This Element contains the number of
* \ingroup gdcmHeader
* \brief Canonical destructor.
*/
-gdcmHeader::~gdcmHeader (void) {
+gdcmHeader::~gdcmHeader () {
}
//-----------------------------------------------------------------------------
* @return true when gdcmHeader is the one of a reasonable Dicom/Acr file,
* false otherwise.
*/
-bool gdcmHeader::IsReadable(void) {
+bool gdcmHeader::IsReadable() {
if(!gdcmDocument::IsReadable()) {
return false;
}
* @return The encountered size when found, 0 by default.
* 0 means the file is NOT USABLE. The caller will have to check
*/
-int gdcmHeader::GetXSize(void) {
+int gdcmHeader::GetXSize() {
std::string StrSize;
StrSize = GetEntryByNumber(0x0028,0x0011);
if (StrSize == GDCM_UNFOUND)
* \brief Retrieve the number of lines of image.
* \warning The defaulted value is 1 as opposed to gdcmHeader::GetXSize()
* @return The encountered size when found, 1 by default
- * (The ACR-MEMA file contains a Signal, not an Image).
+ * (The ACR-NEMA file contains a Signal, not an Image).
*/
-int gdcmHeader::GetYSize(void) {
+int gdcmHeader::GetYSize() {
std::string StrSize = GetEntryByNumber(0x0028,0x0010);
if (StrSize != GDCM_UNFOUND)
return atoi(StrSize.c_str());
* being the ACR-NEMA "Planes" tag content.
* @return The encountered size when found, 1 by default (single image).
*/
-int gdcmHeader::GetZSize(void) {
+int gdcmHeader::GetZSize() {
// Both DicomV3 and ACR/Nema consider the "Number of Frames"
// as the third dimension.
std::string StrSize = GetEntryByNumber(0x0028,0x0008);
* \brief gets the info from 0008,0060 : Modality
* @return Modality Type
*/
-ModalityType gdcmHeader::GetModality(void) {
+ModalityType gdcmHeader::GetModality() {
// 0008 0060 CS ID Modality
std::string StrModality = GetEntryByNumber(0x0008,0x0060);
if (StrModality != GDCM_UNFOUND) {
* @return The encountered number of Bits Allocated, 0 by default.
* 0 means the file is NOT USABLE. The caller has to check it !
*/
-int gdcmHeader::GetBitsAllocated(void) {
+int gdcmHeader::GetBitsAllocated() {
std::string StrSize = GetEntryByNumber(0x0028,0x0100);
if (StrSize == GDCM_UNFOUND)
return 0; // It's supposed to be mandatory
* @return The encountered number of Samples Per Pixel, 1 by default.
* (Gray level Pixels)
*/
-int gdcmHeader::GetSamplesPerPixel(void) {
+int gdcmHeader::GetSamplesPerPixel() {
std::string StrSize = GetEntryByNumber(0x0028,0x0002);
if (StrSize == GDCM_UNFOUND)
return 1; // Well, it's supposed to be mandatory ...
* (0 : RGB Pixels , 1 : R Plane + G Plane + B Plane)
* @return The encountered Planar Configuration, 0 by default.
*/
-int gdcmHeader::GetPlanarConfiguration(void) {
+int gdcmHeader::GetPlanarConfiguration() {
std::string StrSize = GetEntryByNumber(0x0028,0x0006);
if (StrSize == GDCM_UNFOUND)
return 0;
* of *image* pixels (not *icone image* pixels, if any !)
* @return Pixel Offset
*/
-size_t gdcmHeader::GetPixelOffset(void) {
+size_t gdcmHeader::GetPixelOffset() {
gdcmDocEntry* PixelElement = GetDocEntryByNumber(GrPixel,NumPixel);
* -in case of embeded compressed image-)
* 0 : NOT USABLE file. The caller has to check.
*/
-size_t gdcmHeader::GetPixelAreaLength(void) {
+size_t gdcmHeader::GetPixelAreaLength() {
gdcmDocEntry* PixelElement = GetDocEntryByNumber(GrPixel,NumPixel);
* when (0028,0004),Photometric Interpretation = [PALETTE COLOR ]
* @ return bit number of each LUT item
*/
-int gdcmHeader::GetLUTNbits(void) {
+int gdcmHeader::GetLUTNbits() {
std::vector<std::string> tokens;
//int LutLength;
//int LutDepth;
* no known Dicom reader deals with them :-(
* @return a RGBA Lookup Table
*/
-unsigned char * gdcmHeader::GetLUTRGBA(void) {
+unsigned char * gdcmHeader::GetLUTRGBA() {
// Not so easy : see
// http://www.barre.nom.fr/medical/dicom2/limitations.html#Color%20Lookup%20Tables
// if Photometric Interpretation # PALETTE COLOR, no LUT to be done
- if (GetEntryByNumber(0x0028,0x0004) != "PALETTE COLOR ") {
+ if (GetEntryByNumber(0x0028,0x0004) != "PALETTE COLOR ") {
return NULL;
}
int lengthR, debR, nbitsR;
std::string LutDescriptionB = GetEntryByNumber(0x0028,0x1103);
if (LutDescriptionB == GDCM_UNFOUND)
return NULL;
-
+
std::vector<std::string> tokens;
tokens.erase(tokens.begin(),tokens.end()); // clean any previous value
GetEntryVoidAreaByNumber(0x0028,0x1202);
unsigned char *lutB = (unsigned char *)
GetEntryVoidAreaByNumber(0x0028,0x1203);
-
+
if (!lutR || !lutG || !lutB ) {
return NULL;
}
* else 1.
* @return The full Transfert Syntax Name (as opposed to Transfert Syntax UID)
*/
-std::string gdcmHeader::GetTransfertSyntaxName(void) {
+std::string gdcmHeader::GetTransfertSyntaxName() {
// use the gdcmTS (TS : Transfert Syntax)
std::string TransfertSyntax = GetEntryByNumber(0x0002,0x0010);
if (TransfertSyntax == GDCM_UNFOUND) {