gdcmDicomDirSerie.cxx
gdcmDicomDirImage.cxx
gdcmDicomDirObject.cxx
+ gdcmPixelStuff.cxx
)
ADD_LIBRARY(gdcm ${libgdcm_la_SOURCES} )
Program: gdcm
Module: $RCSfile: gdcmBinEntry.cxx,v $
Language: C++
- Date: $Date: 2004/09/23 10:17:26 $
- Version: $Revision: 1.30 $
+ Date: $Date: 2004/09/24 11:39:21 $
+ Version: $Revision: 1.31 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
gdcmDocEntry::Print(os);
std::ostringstream s;
- void *binArea = GetBinArea();
+ void* binArea = GetBinArea();
if (binArea)
{
//s << " [" << GDCM_BINLOADED
* @param fp already open file pointer
* @param filetype type of the file to be written
*/
-void gdcmBinEntry::Write(FILE *fp, FileType filetype)
+void gdcmBinEntry::Write(FILE* fp, FileType filetype)
{
gdcmDocEntry::Write(fp, filetype);
- void *binArea = GetBinArea();
+ void* binArea = GetBinArea();
int lgr = GetLength();
if (binArea)
{
Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2004/09/23 10:47:10 $
- Version: $Revision: 1.68 $
+ Date: $Date: 2004/09/24 11:39:21 $
+ Version: $Revision: 1.69 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param argDelete Argument
* \warning In python : the arg parameter isn't considered
*/
-void gdcmDicomDir::SetStartMethod(gdcmMethod *method, void *arg,
- gdcmMethod *argDelete )
+void gdcmDicomDir::SetStartMethod(gdcmMethod* method, void* arg,
+ gdcmMethod* argDelete )
{
if( startArg && startMethodArgDelete )
{
* class is destroyed
* @param method Method to call to delete the argument
*/
-void gdcmDicomDir::SetStartMethodArgDelete(gdcmMethod *method)
+void gdcmDicomDir::SetStartMethodArgDelete(gdcmMethod* method)
{
startMethodArgDelete = method;
}
* @param argDelete Argument
* \warning In python : the arg parameter isn't considered
*/
-void gdcmDicomDir::SetProgressMethod(gdcmMethod *method, void *arg,
- gdcmMethod *argDelete )
+void gdcmDicomDir::SetProgressMethod(gdcmMethod* method, void* arg,
+ gdcmMethod* argDelete )
{
if( progressArg && progressMethodArgDelete )
{
* class is destroyed
* @param method Method to call to delete the argument
*/
-void gdcmDicomDir::SetProgressMethodArgDelete(gdcmMethod *method)
+void gdcmDicomDir::SetProgressMethodArgDelete(gdcmMethod* method)
{
progressMethodArgDelete = method;
}
* @param argDelete Argument
* \warning In python : the arg parameter isn't considered
*/
-void gdcmDicomDir::SetEndMethod(gdcmMethod *method, void *arg,
- gdcmMethod *argDelete )
+void gdcmDicomDir::SetEndMethod(gdcmMethod* method, void* arg,
+ gdcmMethod* argDelete )
{
if( endArg && endMethodArgDelete )
{
* is destroyed
* @param method Method to call to delete the argument
*/
-void gdcmDicomDir::SetEndMethodArgDelete(gdcmMethod *method)
+void gdcmDicomDir::SetEndMethodArgDelete(gdcmMethod* method)
{
endMethodArgDelete = method;
}
* @return false only when fail to open
*/
-bool gdcmDicomDir::WriteDicomDir(std::string const & fileName)
+bool gdcmDicomDir::WriteDicomDir(std::string const& fileName)
{
uint16_t sq[4] = { 0x0004, 0x1220, 0xffff, 0xffff };
uint16_t sqt[4]= { 0xfffe, 0xe0dd, 0xffff, 0xffff };
- FILE * fp = fopen(fileName.c_str(), "wb");
+ FILE* fp = fopen(fileName.c_str(), "wb");
if( !fp )
{
printf("Failed to open(write) File [%s] \n", fileName.c_str());
Program: gdcm
Module: $RCSfile: gdcmDicomDir.h,v $
Language: C++
- Date: $Date: 2004/09/23 23:28:19 $
- Version: $Revision: 1.30 $
+ Date: $Date: 2004/09/24 11:39:21 $
+ Version: $Revision: 1.31 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
typedef std::list<gdcmDicomDirPatient*> ListDicomDirPatient;
typedef std::vector<gdcmDocument*> VectDocument;
-typedef GDCM_EXPORT void(gdcmMethod)(void * = NULL);
+typedef GDCM_EXPORT void(gdcmMethod)(void* = NULL);
//-----------------------------------------------------------------------------
/**
// Parsing
void ParseDirectory();
- void SetStartMethod(gdcmMethod *,void * =NULL,gdcmMethod * =NULL);
- void SetStartMethodArgDelete(gdcmMethod *);
- void SetProgressMethod(gdcmMethod *,void * =NULL,gdcmMethod * =NULL);
- void SetProgressMethodArgDelete(gdcmMethod *);
- void SetEndMethod(gdcmMethod *,void * =NULL,gdcmMethod * =NULL);
- void SetEndMethodArgDelete(gdcmMethod *);
+ void SetStartMethod(gdcmMethod*, void* = NULL, gdcmMethod* = NULL);
+ void SetStartMethodArgDelete(gdcmMethod*);
+ void SetProgressMethod(gdcmMethod* ,void* = NULL, gdcmMethod* = NULL);
+ void SetProgressMethodArgDelete(gdcmMethod*);
+ void SetEndMethod(gdcmMethod*, void* = NULL,gdcmMethod* = NULL);
+ void SetEndMethodArgDelete(gdcmMethod*);
/// GetProgress GetProgress
float GetProgress() { return progress; };
void Initialize();
void CreateDicomDir();
void AddDicomDirMeta();
- void AddDicomDirPatientToEnd(gdcmSQItem *s);
- void AddDicomDirStudyToEnd (gdcmSQItem *s);
- void AddDicomDirSerieToEnd (gdcmSQItem *s);
- void AddDicomDirImageToEnd (gdcmSQItem *s);
+ void AddDicomDirPatientToEnd(gdcmSQItem* s);
+ void AddDicomDirStudyToEnd (gdcmSQItem* s);
+ void AddDicomDirSerieToEnd (gdcmSQItem* s);
+ void AddDicomDirImageToEnd (gdcmSQItem* s);
void SetElements(std::string &path, VectDocument &list);
void SetElement (std::string &path,gdcmDicomDirType type,
- gdcmDocument *header);
+ gdcmDocument* header);
- static bool HeaderLessThan(gdcmDocument *header1,gdcmDocument *header2);
+ static bool HeaderLessThan(gdcmDocument* header1,gdcmDocument* header2);
// Variables
/// Pointer on *the* gdcmDicomDirObject 'DicomDirMeta Elements'
- gdcmDicomDirMeta *metaElems;
+ gdcmDicomDirMeta* metaElems;
/// Chained list of DicomDirPatient (to be exploited recursively)
ListDicomDirPatient patients;
/// pointer to the initialisation method for any progress bar
- gdcmMethod *startMethod;
+ gdcmMethod* startMethod;
/// pointer to the incrementation method for any progress bar
- gdcmMethod *progressMethod;
+ gdcmMethod* progressMethod;
/// pointer to the termination method for any progress bar
- gdcmMethod *endMethod;
+ gdcmMethod* endMethod;
/// pointer to the ??? method for any progress bar
- gdcmMethod *startMethodArgDelete;
+ gdcmMethod* startMethodArgDelete;
/// pointer to the ??? method for any progress bar
- gdcmMethod *progressMethodArgDelete;
+ gdcmMethod* progressMethodArgDelete;
/// pointer to the ??? method for any progress bar
- gdcmMethod *endMethodArgDelete;
+ gdcmMethod* endMethodArgDelete;
/// pointer to the ??? for any progress bar
- void *startArg;
+ void* startArg;
/// pointer to the ??? for any progress bar
- void *progressArg;
+ void* progressArg;
/// pointer to the ??? for any progress bar
- void *endArg;
+ void* endArg;
/// value of the ??? for any progress bar
float progress;
/// value of the ??? for any progress bar
Program: gdcm
Module: $RCSfile: gdcmDicomDirMeta.cxx,v $
Language: C++
- Date: $Date: 2004/09/23 10:47:10 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2004/09/24 11:39:21 $
+ Version: $Revision: 1.10 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \ingroup gdcmMeta
* \brief Constructor
*/
-gdcmDicomDirMeta::gdcmDicomDirMeta(TagDocEntryHT *ptagHT):
+gdcmDicomDirMeta::gdcmDicomDirMeta(TagDocEntryHT* ptagHT):
gdcmDicomDirObject(ptagHT)
{
/**
* \brief Prints the Meta Elements
*/
-void gdcmDicomDirMeta::Print(std::ostream &os)
+void gdcmDicomDirMeta::Print(std::ostream& os)
{
os << "META" << std::endl;
// warning : META doesn't behave exactly like a gdcmObjet
* \brief Writes the Meta Elements
* @return
*/
-void gdcmDicomDirMeta::Write(FILE *fp, FileType t)
+void gdcmDicomDirMeta::Write(FILE* fp, FileType t)
{
for (ListDocEntry::iterator i = docEntries.begin();
i != docEntries.end();
Program: gdcm
Module: $RCSfile: gdcmDicomDirPatient.cxx,v $
Language: C++
- Date: $Date: 2004/09/23 10:47:10 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2004/09/24 11:39:21 $
+ Version: $Revision: 1.13 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param ptagHT pointer to the HTable (gdcmDicomDirObject needs it
* to build the gdcmHeaderEntries)
*/
-gdcmDicomDirPatient::gdcmDicomDirPatient(TagDocEntryHT *ptagHT):
+gdcmDicomDirPatient::gdcmDicomDirPatient(TagDocEntryHT* ptagHT):
gdcmDicomDirObject(ptagHT)
{
}
* \brief Prints the Object
* @return
*/
-void gdcmDicomDirPatient::Print(std::ostream &os)
+void gdcmDicomDirPatient::Print(std::ostream& os)
{
os << "PATIENT" << std::endl;
gdcmDicomDirObject::Print(os);
* \brief Writes the Object
* @return
*/
-void gdcmDicomDirPatient::Write(FILE *fp, FileType t)
+void gdcmDicomDirPatient::Write(FILE* fp, FileType t)
{
gdcmDicomDirObject::Write(fp, t);
* \brief adds a new Patient at the begining of the PatientList
* of a partially created DICOMDIR
*/
-gdcmDicomDirStudy * gdcmDicomDirPatient::NewStudy()
+gdcmDicomDirStudy* gdcmDicomDirPatient::NewStudy()
{
std::list<gdcmElement> elemList =
gdcmGlobal::GetDicomDirElements()->GetDicomDirStudyElements();
- gdcmDicomDirStudy *st = new gdcmDicomDirStudy( PtagHT );
+ gdcmDicomDirStudy* st = new gdcmDicomDirStudy( PtagHT );
st->FillObject(elemList);
studies.push_front(st);
Program: gdcm
Module: $RCSfile: gdcmDicomDirSerie.cxx,v $
Language: C++
- Date: $Date: 2004/09/23 10:47:10 $
- Version: $Revision: 1.14 $
+ Date: $Date: 2004/09/24 11:39:21 $
+ Version: $Revision: 1.15 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param ptagHT pointer to the HTable (gdcmDicomDirObject needs it
* to build the gdcmDocEntries)
*/
-gdcmDicomDirSerie::gdcmDicomDirSerie(gdcmSQItem *s, TagDocEntryHT *ptagHT):
+gdcmDicomDirSerie::gdcmDicomDirSerie(gdcmSQItem* s, TagDocEntryHT* ptagHT):
gdcmDicomDirObject(ptagHT)
{
docEntries = s->GetDocEntries();
* @param ptagHT pointer to the HTable (gdcmDicomDirObject needs it
* to build the gdcmDocEntries)
*/
-gdcmDicomDirSerie::gdcmDicomDirSerie(TagDocEntryHT *ptagHT):
+gdcmDicomDirSerie::gdcmDicomDirSerie(TagDocEntryHT* ptagHT):
gdcmDicomDirObject(ptagHT)
{
}
* \brief Prints the Object
* @return
*/
-void gdcmDicomDirSerie::Print(std::ostream &os)
+void gdcmDicomDirSerie::Print(std::ostream& os)
{
os << "SERIE" << std::endl;
gdcmDicomDirObject::Print(os);
* \brief Writes the Object
* @return
*/
-void gdcmDicomDirSerie::Write(FILE *fp, FileType t)
+void gdcmDicomDirSerie::Write(FILE* fp, FileType t)
{
gdcmDicomDirObject::Write(fp, t);
/**
* \brief adds a new Image (with the basic elements) to a partially created DICOMDIR
*/
-gdcmDicomDirImage * gdcmDicomDirSerie::NewImage()
+gdcmDicomDirImage* gdcmDicomDirSerie::NewImage()
{
std::list<gdcmElement> elemList =
gdcmGlobal::GetDicomDirElements()->GetDicomDirImageElements();
- gdcmDicomDirImage *st = new gdcmDicomDirImage(PtagHT);
+ gdcmDicomDirImage* st = new gdcmDicomDirImage(PtagHT);
FillObject(elemList);
images.push_front(st);
Program: gdcm
Module: $RCSfile: gdcmDicomDirStudy.cxx,v $
Language: C++
- Date: $Date: 2004/09/23 10:47:10 $
- Version: $Revision: 1.11 $
+ Date: $Date: 2004/09/24 11:39:21 $
+ Version: $Revision: 1.12 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param ptagHT pointer to the HTable (gdcmDicomDirObject needs it
* to build the gdcmHeaderEntries)
*/
-gdcmDicomDirStudy::gdcmDicomDirStudy(gdcmSQItem *s, TagDocEntryHT *ptagHT):
+gdcmDicomDirStudy::gdcmDicomDirStudy(gdcmSQItem* s, TagDocEntryHT* ptagHT):
gdcmDicomDirObject(ptagHT)
{
docEntries = s->GetDocEntries();
* @param ptagHT pointer to the HTable (gdcmDicomDirObject needs it
* to build the gdcmHeaderEntries)
*/
-gdcmDicomDirStudy::gdcmDicomDirStudy(TagDocEntryHT *ptagHT):
+gdcmDicomDirStudy::gdcmDicomDirStudy(TagDocEntryHT* ptagHT):
gdcmDicomDirObject(ptagHT)
{
}
* \brief Prints the Object
* @return
*/
-void gdcmDicomDirStudy::Print(std::ostream &os)
+void gdcmDicomDirStudy::Print(std::ostream& os)
{
os << "STUDY" << std::endl;
gdcmDicomDirObject::Print(os);
* \brief Writes the Object
* @return
*/
-void gdcmDicomDirStudy::Write(FILE *fp, FileType t)
+void gdcmDicomDirStudy::Write(FILE* fp, FileType t)
{
gdcmDicomDirObject::Write(fp, t);
* \brief adds a new Serie at the begining of the SerieList
* of a partially created DICOMDIR
*/
-gdcmDicomDirSerie * gdcmDicomDirStudy::NewSerie()
+gdcmDicomDirSerie* gdcmDicomDirStudy::NewSerie()
{
std::list<gdcmElement> elemList =
gdcmGlobal::GetDicomDirElements()->GetDicomDirSerieElements();
- gdcmDicomDirSerie *st = new gdcmDicomDirSerie(PtagHT);
+ gdcmDicomDirSerie* st = new gdcmDicomDirSerie(PtagHT);
FillObject(elemList);
series.push_front(st);
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2004/09/23 10:17:26 $
- Version: $Revision: 1.90 $
+ Date: $Date: 2004/09/24 11:39:21 $
+ Version: $Revision: 1.91 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/**
* \brief Get the public dictionary used
*/
-gdcmDict *gdcmDocument::GetPubDict()
+gdcmDict* gdcmDocument::GetPubDict()
{
return RefPubDict;
}
/**
* \brief Get the shadow dictionary used
*/
-gdcmDict *gdcmDocument::GetShaDict()
+gdcmDict* gdcmDocument::GetShaDict()
{
return RefShaDict;
}
* \return pointer to the modified/created Header Entry (NULL when creation
* failed).
*/
-gdcmValEntry * gdcmDocument::ReplaceOrCreateByNumber(
+gdcmValEntry* gdcmDocument::ReplaceOrCreateByNumber(
std::string const & value,
uint16_t group,
uint16_t elem,
// Find out if the tag we received is in the dictionaries:
gdcmDict *pubDict = gdcmGlobal::GetDicts()->GetDefaultPubDict();
- gdcmDictEntry *dictEntry = pubDict->GetDictEntryByNumber(group, elem);
+ gdcmDictEntry* dictEntry = pubDict->GetDictEntryByNumber(group, elem);
if (!dictEntry)
{
currentEntry = NewDocEntryByNumber(group, elem,VR);
* \return pointer to the modified/created Header Entry (NULL when creation
* failed).
*/
-gdcmBinEntry * gdcmDocument::ReplaceOrCreateByNumber(
+gdcmBinEntry* gdcmDocument::ReplaceOrCreateByNumber(
uint8_t* binArea,
int lgth,
uint16_t group,
uint16_t elem,
- std::string const & VR )
+ std::string const& VR )
{
gdcmBinEntry* binEntry = 0;
gdcmDocEntry* currentEntry = GetDocEntryByNumber( group, elem);
* \return pointer to the modified/created SeqEntry (NULL when creation
* failed).
*/
-gdcmSeqEntry * gdcmDocument::ReplaceOrCreateByNumber(
+gdcmSeqEntry* gdcmDocument::ReplaceOrCreateByNumber(
uint16_t group,
uint16_t elem)
{
* @return Corresponding element value when it exists,
* and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise.
*/
-std::string gdcmDocument::GetEntryByName(TagName const & tagName)
+std::string gdcmDocument::GetEntryByName(TagName const& tagName)
{
- gdcmDictEntry *dictEntry = RefPubDict->GetDictEntryByName(tagName);
+ gdcmDictEntry* dictEntry = RefPubDict->GetDictEntryByName(tagName);
if( !dictEntry )
{
return GDCM_UNFOUND;
* @return Corresponding element value representation when it exists,
* and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise.
*/
-std::string gdcmDocument::GetEntryVRByName(TagName const & tagName)
+std::string gdcmDocument::GetEntryVRByName(TagName const& tagName)
{
gdcmDictEntry *dictEntry = RefPubDict->GetDictEntryByName(tagName);
if( dictEntry == NULL)
* @param group group number of the Dicom Element to modify
* @param element element number of the Dicom Element to modify
*/
-bool gdcmDocument::SetEntryByNumber(std::string const & content,
+bool gdcmDocument::SetEntryByNumber(std::string const& content,
uint16_t group,
uint16_t element)
{
* \brief Accesses an existing gdcmDocEntry (i.e. a Dicom Element)
* through it's (group, element) and modifies it's content with
* the given value.
- * @param content new value (void * -> uint8_t*) to substitute with
+ * @param content new value (void* -> uint8_t*) to substitute with
* @param lgth new value length
* @param group group number of the Dicom Element to modify
* @param element element number of the Dicom Element to modify
* @param elem element number of the Entry
* @return Pointer to the 'non string' area
*/
-void * gdcmDocument::GetEntryBinAreaByNumber(uint16_t group, uint16_t elem)
+void* gdcmDocument::GetEntryBinAreaByNumber(uint16_t group, uint16_t elem)
{
gdcmDocEntry* entry = GetDocEntryByNumber(group, elem);
if (!entry)
* when a string is not suitable
* @param element Entry whose binArea is going to be loaded
*/
-void *gdcmDocument::LoadEntryBinArea(gdcmBinEntry *element)
+void* gdcmDocument::LoadEntryBinArea(gdcmBinEntry* element)
{
size_t o =(size_t)element->GetOffset();
fseek(Fp, o, SEEK_SET);
Program: gdcm
Module: $RCSfile: gdcmElementSet.cxx,v $
Language: C++
- Date: $Date: 2004/09/22 01:01:36 $
- Version: $Revision: 1.21 $
+ Date: $Date: 2004/09/24 11:39:21 $
+ Version: $Revision: 1.22 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* from the H Table
* @return
*/
-void gdcmElementSet::Print(std::ostream & os)
+void gdcmElementSet::Print(std::ostream& os)
{
for( TagDocEntryHT::const_iterator i = TagHT.begin(); i != TagHT.end(); ++i)
{
* from the H Table
* @return
*/
-void gdcmElementSet::Write(FILE *fp, FileType filetype)
+void gdcmElementSet::Write(FILE* fp, FileType filetype)
{
for (TagDocEntryHT::const_iterator i = TagHT.begin(); i != TagHT.end(); ++i)
{
* \brief add a new Dicom Element pointer to the H Table
* @param newEntry entry to add
*/
-bool gdcmElementSet::AddEntry( gdcmDocEntry *newEntry)
+bool gdcmElementSet::AddEntry( gdcmDocEntry* newEntry)
{
gdcmTagKey key = newEntry->GetKey();
* \brief Clear the hash table from given entry BUT keep the entry.
* @param entryToRemove Entry to remove.
*/
-bool gdcmElementSet::RemoveEntryNoDestroy( gdcmDocEntry *entryToRemove)
+bool gdcmElementSet::RemoveEntryNoDestroy( gdcmDocEntry* entryToRemove)
{
gdcmTagKey key = entryToRemove->GetKey();
if( TagHT.count(key) == 1 )
* \brief Clear the hash table from given entry AND delete the entry.
* @param entryToRemove Entry to remove AND delete.
*/
-bool gdcmElementSet::RemoveEntry( gdcmDocEntry *entryToRemove)
+bool gdcmElementSet::RemoveEntry( gdcmDocEntry* entryToRemove)
{
gdcmTagKey key = entryToRemove->GetKey();
if( TagHT.count(key) == 1 )
Program: gdcm
Module: $RCSfile: gdcmFile.cxx,v $
Language: C++
- Date: $Date: 2004/09/23 10:17:26 $
- Version: $Revision: 1.128 $
+ Date: $Date: 2004/09/24 11:39:21 $
+ Version: $Revision: 1.129 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @return On success, the number of bytes actually copied. Zero on
* failure e.g. MaxSize is lower than necessary.
*/
-size_t gdcmFile::GetImageDataIntoVectorRaw (void *destination, size_t maxSize)
+size_t gdcmFile::GetImageDataIntoVectorRaw (void* destination, size_t maxSize)
{
int nb, nbu, highBit, sign;
// Nobody knows what's expecting you ...
// Just to 'see' what was actually read on disk :-(
-// FILE * f2;
+// FILE* f2;
// f2 = fopen("SpuriousFile.RAW","wb");
// fwrite(destination,ImageDataSize,1,f2);
// fclose(f2);
bool gdcmFile::WriteRawData(std::string const & fileName)
{
- FILE *fp1 = fopen(fileName.c_str(), "wb");
+ FILE* fp1 = fopen(fileName.c_str(), "wb");
if (fp1 == NULL)
{
printf("Fail to open (write) file [%s] \n", fileName.c_str());
return false;
}
- FILE *fp1 = fopen(fileName.c_str(), "wb");
+ FILE* fp1 = fopen(fileName.c_str(), "wb");
if (fp1 == NULL)
{
printf("Failed to open (write) File [%s] \n", fileName.c_str());
* @param lgr Area Length
* @param nb Pixels Bit number
*/
-void gdcmFile::SwapZone(void *im, int swap, int lgr, int nb)
+void gdcmFile::SwapZone(void* im, int swap, int lgr, int nb)
{
int i;
* @param destination where the pixel data should be stored.
*
*/
-bool gdcmFile::ReadPixelData(void *destination)
+bool gdcmFile::ReadPixelData(void* destination)
{
- FILE *fp = Header->OpenFile();
+ FILE* fp = Header->OpenFile();
if ( !fp )
{
Program: gdcm
Module: $RCSfile: gdcmFile.h,v $
Language: C++
- Date: $Date: 2004/09/23 09:40:30 $
- Version: $Revision: 1.50 $
+ Date: $Date: 2004/09/24 11:39:21 $
+ Version: $Revision: 1.51 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
public:
gdcmFile( gdcmHeader *header );
- gdcmFile( std::string const & filename );
+ gdcmFile( std::string const& filename );
virtual ~gdcmFile();
bool SetImageData (uint8_t* data, size_t expectedSize);
/// \todo When the caller is aware we simply point to the data:
- /// int SetImageDataNoCopy (void * Data, size_t ExpectedSize);
+ /// int SetImageDataNoCopy (void* Data, size_t ExpectedSize);
// Write pixels of ONE image on hard drive
// No test is made on processor "endianity"
// The user must call his reader correctly
- bool WriteRawData (std::string const & fileName);
- bool WriteDcmImplVR(std::string const & fileName);
- bool WriteDcmExplVR(std::string const & fileName);
- bool WriteAcr (std::string const & fileName);
+ bool WriteRawData (std::string const& fileName);
+ bool WriteDcmImplVR(std::string const& fileName);
+ bool WriteDcmExplVR(std::string const& fileName);
+ bool WriteAcr (std::string const& fileName);
// Don't look any longer for the code :
// It's in file gdcmParsePixels.cxx
bool ParsePixelData();
- virtual bool SetEntryByNumber(std::string const & content,
+ virtual bool SetEntryByNumber(std::string const& content,
uint16_t group, uint16_t element)
{
Header->SetEntryByNumber(content,group,element);
}
protected:
- bool WriteBase(std::string const & fileName, FileType type);
+ bool WriteBase(std::string const& fileName, FileType type);
private:
void SwapZone(void* im, int swap, int lgr, int nb);
- bool ReadPixelData(void * destination);
+ bool ReadPixelData(void* destination);
// For JPEG 8 Bits, body in file gdcmJpeg.cxx
- bool gdcm_read_JPEG_file (FILE *fp, void * image_buffer);
- bool gdcm_write_JPEG_file (FILE *fp, void * image_buffer,
+ bool gdcm_read_JPEG_file (FILE* fp, void* image_buffer);
+ bool gdcm_write_JPEG_file (FILE* fp, void* image_buffer,
int image_width, int image_heigh,
int quality);
// For JPEG 12 Bits, body in file gdcmJpeg12.cxx
- bool gdcm_read_JPEG_file12 (FILE *fp, void* image_buffer);
- bool gdcm_write_JPEG_file12 (FILE *fp, void* image_buffer,
+ bool gdcm_read_JPEG_file12 (FILE* fp, void* image_buffer);
+ bool gdcm_write_JPEG_file12 (FILE* fp, void* image_buffer,
int image_width, int image_height,
int quality);
// For JPEG 2000, body in file gdcmJpeg2000.cxx
- bool gdcm_read_JPEG2000_file (FILE *fp, void* image_buffer);
+ bool gdcm_read_JPEG2000_file (FILE* fp, void* image_buffer);
// For Run Length Encoding
- bool gdcm_read_RLE_file (FILE *fp, void* image_buffer);
+ bool gdcm_read_RLE_file (FILE* fp, void* image_buffer);
// FIXME : *sure* it's NOT static (C++)
// (would be static in C, or embedded in ADA)
// It's NOT a method, but a not user intended fonction.
// How do we write that in C++ ?)
static int gdcm_read_RLE_fragment(char **areaToRead, long lengthToDecode,
- long uncompressedSegmentSize, FILE *fp);
+ long uncompressedSegmentSize, FILE* fp);
void SaveInitialValues(); // will belong to the future gdcmPixelData class
void RestoreInitialValues(); // will belong to the future gdcmPixelData class
* @return 1 on success, 0 on error
*/
-bool gdcm_write_JPEG_file (FILE *fp, void * im_buf,
+bool gdcm_write_JPEG_file (FILE* fp, void* im_buf,
int image_width, int image_height, int quality)
{
*/
struct jpeg_error_mgr jerr;
/* More stuff */
- //FILE * outfile; /* target file */
+ //FILE* outfile; /* target FILE* /
JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */
int row_stride; /* physical row width in image buffer */
};
//-----------------------------------------------------------------------------
-typedef struct my_error_mgr * my_error_ptr;
+typedef struct my_error_mgr* my_error_ptr;
/*
* Here's the routine that will replace the standard error_exit method:
* @return 1 on success, 0 on error
*/
-bool gdcmFile::gdcm_read_JPEG_file (FILE *fp,void * image_buffer) {
- char *pimage;
+bool gdcmFile::gdcm_read_JPEG_file (FILE* fp, void* image_buffer) {
+ char* pimage;
/* This struct contains the JPEG decompression parameters and pointers to
* working space (which is allocated as needed by the JPEG library).
// TODO
//
-bool gdcm_write_JPEG_file12 (FILE *fp, void * im_buff,
+bool gdcm_write_JPEG_file12 (FILE* fp, void* im_buff,
int image_width, int image_heigh, int quality)
{
(void)fp;
* @return 1 on success, 0 on error
*/
-bool gdcmFile::gdcm_read_JPEG_file12 (FILE *fp,void * image_buffer) {
+bool gdcmFile::gdcm_read_JPEG_file12 (FILE* fp,void* image_buffer) {
char *pimage;
/* This struct contains the JPEG decompression parameters and pointers to
* @warning : not yet made
*/
-bool gdcmFile::gdcm_read_JPEG2000_file (FILE *fp,void * image_buffer) {
+bool gdcmFile::gdcm_read_JPEG2000_file (FILE* fp,void* image_buffer) {
(void)fp; //FIXME
(void)image_buffer; //FIXME
printf("Sorry JPEG 2000 File not yet taken into account\n");
Program: gdcm
Module: $RCSfile: gdcmParsePixels.cxx,v $
Language: C++
- Date: $Date: 2004/07/17 22:47:01 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2004/09/24 11:39:21 $
+ Version: $Revision: 1.10 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
bool gdcmFile::ParsePixelData(void) {
// DO NOT remove the printf s.
// The ONLY purpose of this method is to PRINT the content
- FILE *fp;
+ FILE* fp;
if ( !(fp=Header->OpenFile()))
return false;
--- /dev/null
+/*=========================================================================
+
+ Program: gdcm
+ Module: $RCSfile: gdcmPixelStuff.cxx,v $
+ Language: C++
+ Date: $Date: 2004/09/24 11:39:21 $
+ Version: $Revision: 1.1 $
+
+ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+ l'Image). All rights reserved. See Doc/License.txt or
+ http://www.creatis.insa-lyon.fr/Public/Gdcm/License.htm 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 notices for more information.
+
+=========================================================================*/
+
+#include "gdcmPixelStuff.h"
+
+
+//-----------------------------------------------------------------------------
+// Constructor / Destructor
+gdcmPixelStuff::gdcmPixelStuff(void)
+{
+
+}
+
+gdcmPixelStuff::~gdcmPixelStuff()
+{
+
+}
+
+
+//-----------------------------------------------------------------------------
+// Public
+
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
+//-----------------------------------------------------------------------------
--- /dev/null
+/*=========================================================================
+
+ Program: gdcm
+ Module: $RCSfile: gdcmPixelStuff.h,v $
+ Language: C++
+ Date: $Date: 2004/09/24 11:39:21 $
+ Version: $Revision: 1.1 $
+
+ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+ l'Image). All rights reserved. See Doc/License.txt or
+ http://www.creatis.insa-lyon.fr/Public/Gdcm/License.htm 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 notices for more information.
+
+=========================================================================*/
+
+
+#ifndef GDCMPIXELSTUFF_H
+#define GDCMPIXELSTUFF_H
+
+#include "gdcmCommon.h"
+
+//-----------------------------------------------------------------------------
+/*
+ * Container for Pixel related stuff
+ * \note This is a singleton
+ */
+class GDCM_EXPORT gdcmPixelStuff {
+public:
+ gdcmPixelStuff(void);
+ ~gdcmPixelStuff();
+
+
+};
+
+//-----------------------------------------------------------------------------
+#endif
Program: gdcm
Module: $RCSfile: gdcmRLE.cxx,v $
Language: C++
- Date: $Date: 2004/07/02 13:55:28 $
- Version: $Revision: 1.21 $
+ Date: $Date: 2004/09/24 11:39:21 $
+ Version: $Revision: 1.22 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* at which the pixel data should be copied
* @return Boolean
*/
-bool gdcmFile::gdcm_read_RLE_file (FILE *fp,void * image_buffer) {
+bool gdcmFile::gdcm_read_RLE_file (FILE* fp,void* image_buffer) {
long fragmentBegining; // for ftell, fseek
char * im = (char *)image_buffer;
// ----------------------------------------------------------------------------
// RLE LossLess Fragment
-int gdcmFile::gdcm_read_RLE_fragment(char **areaToRead, long lengthToDecode,
- long uncompressedSegmentSize, FILE *fp) {
+int gdcmFile::gdcm_read_RLE_fragment(char** areaToRead, long lengthToDecode,
+ long uncompressedSegmentSize, FILE* fp) {
(void)lengthToDecode; //FIXME
long ftellRes;
int count;
Program: gdcm
Module: $RCSfile: gdcmSQItem.cxx,v $
Language: C++
- Date: $Date: 2004/09/16 19:21:57 $
- Version: $Revision: 1.26 $
+ Date: $Date: 2004/09/24 11:39:21 $
+ Version: $Revision: 1.27 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/*
* \brief canonical Printer
*/
- void gdcmSQItem::Print(std::ostream & os)
+ void gdcmSQItem::Print(std::ostream& os)
{
std::ostringstream s;
* \ingroup gdcmSQItem
* \brief canonical Writer
*/
-void gdcmSQItem::Write(FILE *fp,FileType filetype)
+void gdcmSQItem::Write(FILE* fp,FileType filetype)
{
uint16_t item[4] = { 0xfffe, 0xe000, 0xffff, 0xffff };
uint16_t itemt[4]= { 0xfffe, 0xe00d, 0xffff, 0xffff };
/**
* \brief adds any Entry (Dicom Element) to the Sequence Item
*/
-bool gdcmSQItem::AddEntry(gdcmDocEntry *entry)
+bool gdcmSQItem::AddEntry(gdcmDocEntry* entry)
{
docEntries.push_back(entry);
//TODO : check if it worked
* @return true if element was found or created successfully
*/
-bool gdcmSQItem::SetEntryByNumber(std::string val,uint16_t group,
+bool gdcmSQItem::SetEntryByNumber(std::string val, uint16_t group,
uint16_t element)
{
for(ListDocEntry::iterator i = docEntries.begin(); i != docEntries.end(); ++i)
* \brief Gets a Dicom Element inside a SQ Item Entry, by number
* @return
*/
-gdcmDocEntry *gdcmSQItem::GetDocEntryByNumber(uint16_t group, uint16_t element)
+gdcmDocEntry* gdcmSQItem::GetDocEntryByNumber(uint16_t group, uint16_t element)
{
for(ListDocEntry::iterator i = docEntries.begin();
i != docEntries.end(); ++i)
Program: gdcm
Module: $RCSfile: gdcmSeqEntry.cxx,v $
Language: C++
- Date: $Date: 2004/09/16 19:21:57 $
- Version: $Revision: 1.28 $
+ Date: $Date: 2004/09/24 11:39:21 $
+ Version: $Revision: 1.29 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/*
* \brief canonical Writer
*/
-void gdcmSeqEntry::Write(FILE *fp, FileType filetype)
+void gdcmSeqEntry::Write(FILE* fp, FileType filetype)
{
uint16_t seq_term_gr = 0xfffe;
uint16_t seq_term_el = 0xe0dd;
* Returns the last item when argument is bigget than the total
* item number.
*/
-gdcmSQItem *gdcmSeqEntry::GetSQItemByOrdinalNumber(int nb)
+gdcmSQItem* gdcmSeqEntry::GetSQItemByOrdinalNumber(int nb)
{
if (nb<0)
return (*(items.begin()));
Program: gdcm
Module: $RCSfile: gdcmValEntry.cxx,v $
Language: C++
- Date: $Date: 2004/09/13 12:10:53 $
- Version: $Revision: 1.25 $
+ Date: $Date: 2004/09/24 11:39:21 $
+ Version: $Revision: 1.26 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/*
* \brief canonical Writer
*/
-void gdcmValEntry::Write(FILE *fp, FileType filetype)
+void gdcmValEntry::Write(FILE* fp, FileType filetype)
{
gdcmDocEntry::Write(fp, filetype);
for (unsigned int i=0; i<tokens.size();i++)
{
uint16_t val_uint16 = atoi(tokens[i].c_str());
- void *ptr = &val_uint16;
+ void* ptr = &val_uint16;
fwrite ( ptr,(size_t)2 ,(size_t)1 ,fp);
}
tokens.clear();
for (unsigned int i=0; i<tokens.size();i++)
{
uint32_t val_uint32 = atoi(tokens[i].c_str());
- void *ptr = &val_uint32;
+ void* ptr = &val_uint32;
fwrite ( ptr,(size_t)4 ,(size_t)1 ,fp);
}
tokens.clear();