Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2004/06/28 09:30:58 $
- Version: $Revision: 1.53 $
+ Date: $Date: 2004/06/28 14:29:52 $
+ Version: $Revision: 1.54 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
// que l'on ai passe un root directory ou un DICOMDIR
// et quelle que soit la valeur de parseDir,
- // on a lance gdcmDocument
+ // on a deja lance gdcmDocument
Initialize();
// gdcmDocument already executed
if (e==NULL) {
dbg.Verbose(0, "gdcmDicomDir::gdcmDicomDir : NO Directory record"
" sequence (0x0004,0x1220)");
- /// \todo FIXME : what to do when the parsed file IS NOT a
+ /// \todo FIXME : what do we do when the parsed file IS NOT a
/// DICOMDIR file ?
}
CreateDicomDir();
it!=fileList.end();
++it)
{
- std::cout << "nom fichier " << it->c_str() << std::endl; //JPR
-
progress=(float)(count+1)/(float)fileList.size();
CallProgressMethod();
if(abort)
break;
- header=new gdcmHeader(it->c_str());
+ header=new gdcmHeader(it->c_str(),false,true);
if(!header) {
std::cout << "echec new Header " << it->c_str() << std::endl; // JPR
}
if(header->IsReadable()) {
list.push_back(header); // adds the file header to the chained list
- std::cout << "readable : " <<it->c_str() << std::endl;
+ std::cout << "readable : " <<it->c_str() << std::endl; // JPR
}
else
delete header;
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2004/06/28 11:01:18 $
- Version: $Revision: 1.38 $
+ Date: $Date: 2004/06/28 14:29:52 $
+ Version: $Revision: 1.39 $
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)
: gdcmElementSet(-1) {
- enableSequences=enable_sequences;
IgnoreShadow =ignore_shadow;
-
+ //enableSequences=enable_sequences;
+ enableSequences=true; // JPR // TODO : remove params out of the constructor
SetMaxSizeLoadEntry(MAX_SIZE_LOAD_ELEMENT_VALUE);
Filename = inFilename;
Initialise();
gdcmDocument::gdcmDocument(bool exception_on_error)
:gdcmElementSet(-1) {
(void)exception_on_error;
- enableSequences=0;
+ //enableSequences=0; // ?!? JPR
SetMaxSizeLoadEntry(MAX_SIZE_LOAD_ELEMENT_VALUE);
Initialise();
* false otherwise.
*/
bool gdcmDocument::IsReadable(void) {
+
if(Filetype==gdcmUnknown) {
- //std::cout << " gdcmDocument::IsReadable: Filetype " << Filetype
- // << " " << "gdcmUnknown " << gdcmUnknown << std::endl; //JPR
+ std::cout << " gdcmDocument::IsReadable: Filetype " << Filetype
+ << " " << "gdcmUnknown " << gdcmUnknown << std::endl; //JPR
dbg.Verbose(0, "gdcmDocument::IsReadable: wrong filetype");
return false;
}
+
if(tagHT.empty()) {
dbg.Verbose(0, "gdcmDocument::IsReadable: no tags in internal"
" hash table.");
Program: gdcm
Module: $RCSfile: gdcmFile.cxx,v $
Language: C++
- Date: $Date: 2004/06/28 14:12:03 $
- Version: $Revision: 1.112 $
+ Date: $Date: 2004/06/28 14:29:52 $
+ Version: $Revision: 1.113 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
Header->SetEntryByNumber(rows , 0x0028, 0x0011);
}
// ----------------- End of Special Patch ----------------
-
- /// \todo get the grPixel, numPixel values (for some ACR-NEMA images only)
-
+
uint16_t grPixel = Header->GetGrPixel();
uint16_t numPixel = Header->GetNumPixel();;
-
- // Update Pixel Data Length
- // the *last* of the (GrPixel, NumPixel), if many.
- TagKey key = gdcmDictEntry::TranslateToKey(grPixel, numPixel);
- TagDocEntryHT::iterator p2;
gdcmDocEntry* PixelElement;
-
- IterHT it = Header->GetEntry().equal_range(key); // get a pair of iterators first-last synonym
- if ( Header->GetEntry().count(key) == 1 ) // only the first is significant
- {
- p2 = it.first; // iterator on the first (unique) synonym
- }
- else
- {
- p2 = it.second;// iterator on the last synonym
- }
-
- PixelElement = p2->second; // H Table target column (2-nd col)
- // PixelElement->SetPrintLevel(2);
- // PixelElement->Print();
+ PixelElement = GetHeader()->GetDocEntryByNumber(grPixel, numPixel);
if ( PixelRead == 1 )
{
+ // we read pixel 'as is' (no tranformation LUT -> RGB)
PixelElement->SetLength( ImageDataSizeRaw );
}
else if ( PixelRead == 0 )
{
+ // we tranformed GrayLevel pixels + LUT into RGB Pixel
PixelElement->SetLength( ImageDataSize );
}
-
- //PixelElement->SetPrintLevel(2);
- //PixelElement->Print();
+
Header->Write(fp1, type);
// --------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmHeader.cxx,v $
Language: C++
- Date: $Date: 2004/06/28 11:01:18 $
- Version: $Revision: 1.172 $
+ Date: $Date: 2004/06/28 14:29:52 $
+ Version: $Revision: 1.173 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// Drop Palette Color, if necessary
if ( GetEntryByNumber(0x0028,0x0002).c_str()[0] == '3' ) {
-
+ // if SamplesPerPixel = 3, sure we don't need any LUT !
// Drop 0028|1101, 0028|1102, 0028|1103
// Drop 0028|1201, 0028|1202, 0028|1203
*/
bool gdcmHeader::IsReadable() {
if(!gdcmDocument::IsReadable()) {
- //std::cout << "doc non Readable " << std::endl; //JPR
return false;
}
std::string res = GetEntryByNumber(0x0028, 0x0005);