gdcmCSAHeader.h
Go to the documentation of this file.
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef GDCMCSAHEADER_H
#define GDCMCSAHEADER_H
#include "gdcmTypes.h"
#include "gdcmDataSet.h"
#include "gdcmCSAElement.h"
#include "gdcmMrProtocol.h"
namespace gdcm
{
/*
* Everything done in this code is for the sole purpose of writing interoperable
* software under Sect. 1201 (f) Reverse Engineering exception of the DMCA.
* If you believe anything in this code violates any law or any of your rights,
* please contact us (gdcm-developers@lists.sourceforge.net) so that we can
* find a solution.
*/
//-----------------------------------------------------------------------------
class DataElement;
class PrivateTag;
class GDCM_EXPORT CSAHeader
{
friend std::ostream& operator<<(std::ostream &_os, const CSAHeader &d);
public :
CSAHeader():InternalDataSet(),InternalType(UNKNOWN),InterfileData(nullptr) {}
~CSAHeader() = default;
typedef enum {
UNKNOWN = 0,
SV10,
NOMAGIC,
DATASET_FORMAT,
INTERFILE,
ZEROED_OUT
} CSAHeaderType;
bool LoadFromDataElement(DataElement const &de);
void Print(std::ostream &os) const;
const DataSet& GetDataSet() const { return InternalDataSet; }
const char * GetInterfile() const { return InterfileData; }
CSAHeaderType GetFormat() const;
static const PrivateTag & GetCSAImageHeaderInfoTag();
static const PrivateTag & GetCSASeriesHeaderInfoTag();
static const PrivateTag & GetCSADataInfo();
const CSAElement &GetCSAElementByName(const char *name);
bool FindCSAElementByName(const char *name);
bool GetMrProtocol( const DataSet & ds, MrProtocol & mrProtocol );
protected:
const CSAElement& GetCSAEEnd() const;
private:
std::set<CSAElement> InternalCSADataSet;
DataSet InternalDataSet;
CSAHeaderType InternalType;
Tag DataElementTag;
static CSAElement CSAEEnd;
const char *InterfileData;
};
//-----------------------------------------------------------------------------
inline std::ostream& operator<<(std::ostream &os, const CSAHeader &d)
{
d.Print( os );
return os;
}
} // end namespace gdcm
//-----------------------------------------------------------------------------
#endif //GDCMCSAHEADER_H
gdcm::CSAElement
Class to represent a CSA Element.
Definition gdcmCSAElement.h:30
gdcm::CSAHeader::GetFormat
CSAHeaderType GetFormat() const
gdcm::CSAHeader::GetCSAImageHeaderInfoTag
static const PrivateTag & GetCSAImageHeaderInfoTag()
gdcm::CSAHeader::~CSAHeader
~CSAHeader()=default
gdcm::CSAHeader::FindCSAElementByName
bool FindCSAElementByName(const char *name)
gdcm::CSAHeader::GetCSAElementByName
const CSAElement & GetCSAElementByName(const char *name)
gdcm::CSAHeader::Print
void Print(std::ostream &os) const
Print the CSAHeader (use only if Format == SV10 or NOMAGIC).
gdcm::CSAHeader::CSAHeader
CSAHeader()
Definition gdcmCSAHeader.h:67
gdcm::CSAHeader::operator<<
friend std::ostream & operator<<(std::ostream &_os, const CSAHeader &d)
Definition gdcmCSAHeader.h:131
gdcm::CSAHeader::GetCSAEEnd
const CSAElement & GetCSAEEnd() const
gdcm::CSAHeader::GetCSASeriesHeaderInfoTag
static const PrivateTag & GetCSASeriesHeaderInfoTag()
gdcm::CSAHeader::GetDataSet
const DataSet & GetDataSet() const
Return the DataSet output (use only if Format == DATASET_FORMAT ).
Definition gdcmCSAHeader.h:87
gdcm::CSAHeader::CSAHeaderType
CSAHeaderType
Diverse format of CSAHeader as found 'in the wild'.
Definition gdcmCSAHeader.h:71
gdcm::CSAHeader::INTERFILE
@ INTERFILE
Definition gdcmCSAHeader.h:76
gdcm::CSAHeader::NOMAGIC
@ NOMAGIC
Definition gdcmCSAHeader.h:74
gdcm::CSAHeader::DATASET_FORMAT
@ DATASET_FORMAT
Definition gdcmCSAHeader.h:75
gdcm::CSAHeader::ZEROED_OUT
@ ZEROED_OUT
Definition gdcmCSAHeader.h:77
gdcm::CSAHeader::UNKNOWN
@ UNKNOWN
Definition gdcmCSAHeader.h:72
gdcm::CSAHeader::SV10
@ SV10
Definition gdcmCSAHeader.h:73
gdcm::CSAHeader::GetInterfile
const char * GetInterfile() const
Return the string output (use only if Format == Interfile).
Definition gdcmCSAHeader.h:90
gdcm::CSAHeader::LoadFromDataElement
bool LoadFromDataElement(DataElement const &de)
Decode the CSAHeader from element 'de'.
gdcm::CSAHeader::GetCSADataInfo
static const PrivateTag & GetCSADataInfo()
gdcm::CSAHeader::GetMrProtocol
bool GetMrProtocol(const DataSet &ds, MrProtocol &mrProtocol)
Retrieve the ASCII portion stored within the MrProtocol/MrPhoenixProtocol:
gdcm::DataElement
Class to represent a Data Element either Implicit or Explicit.
Definition gdcmDataElement.h:59
gdcm::DataSet
Class to represent a Data Set (which contains Data Elements).
Definition gdcmDataSet.h:56
gdcm::MrProtocol
Class for MrProtocol.
Definition gdcmMrProtocol.h:37
gdcm::PrivateTag
Class to represent a Private DICOM Data Element (Attribute) Tag (Group, Element, Owner).
Definition gdcmPrivateTag.h:39
gdcm::Tag
Class to represent a DICOM Data Element (Attribute) Tag (Group, Element).
Definition gdcmTag.h:39
gdcmCSAElement.h
gdcmDataSet.h
gdcmMrProtocol.h
gdcmTypes.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21
gdcm::operator<<
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition gdcmDirectory.h:88