1 /*=========================================================================
4 Module: $RCSfile: gdcmFile.cxx,v $
6 Date: $Date: 2005/01/11 16:44:43 $
7 Version: $Revision: 1.190 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
20 #include "gdcmGlobal.h"
22 #include "gdcmDocument.h"
23 #include "gdcmDebug.h"
25 #include "gdcmBinEntry.h"
26 #include "gdcmHeader.h"
27 #include "gdcmPixelReadConvert.h"
28 #include "gdcmPixelWriteConvert.h"
29 #include "gdcmDocEntryArchive.h"
35 typedef std::pair<TagDocEntryHT::iterator,TagDocEntryHT::iterator> IterHT;
37 //-------------------------------------------------------------------------
38 // Constructor / Destructor
40 * \brief Constructor dedicated to deal with the *pixels* area of a ACR/DICOMV3
41 * file (Header only deals with the ... header)
42 * Opens (in read only and when possible) an existing file and checks
43 * for DICOM compliance. Returns NULL on failure.
44 * It will be up to the user to load the pixels into memory
45 * (see GetImageData, GetImageDataRaw)
46 * \note the in-memory representation of all available tags found in
47 * the DICOM header is post-poned to first header information access.
48 * This avoid a double parsing of public part of the header when
49 * one sets an a posteriori shadow dictionary (efficiency can be
50 * seen as a side effect).
54 HeaderInternal = new Header( );
60 * \brief Constructor dedicated to deal with the *pixels* area of a ACR/DICOMV3
61 * file (Header only deals with the ... header)
62 * Opens (in read only and when possible) an existing file and checks
63 * for DICOM compliance. Returns NULL on failure.
64 * It will be up to the user to load the pixels into memory
65 * (see GetImageData, GetImageDataRaw)
66 * \note the in-memory representation of all available tags found in
67 * the DICOM header is post-poned to first header information access.
68 * This avoid a double parsing of public part of the header when
69 * user sets an a posteriori shadow dictionary (efficiency can be
70 * seen as a side effect).
71 * @param header already built Header
73 File::File(Header *header)
75 HeaderInternal = header;
81 * \brief Constructor dedicated to deal with the *pixels* area of a ACR/DICOMV3
82 * file (Header only deals with the ... header)
83 * Opens (in read only and when possible) an existing file and checks
84 * for DICOM compliance. Returns NULL on failure.
85 * It will be up to the user to load the pixels into memory
86 * (see GetImageData, GetImageDataRaw)
87 * \note the in-memory representation of all available tags found in
88 * the DICOM header is post-poned to first header information access.
89 * This avoid a double parsing of public part of the header when
90 * one sets an a posteriori shadow dictionary (efficiency can be
91 * seen as a side effect).
92 * @param filename file to be opened for parsing
94 File::File(std::string const & filename )
96 HeaderInternal = new Header( filename );
102 * \brief canonical destructor
103 * \note If the Header was created by the File constructor,
104 * it is destroyed by the File
108 if( PixelReadConverter )
110 delete PixelReadConverter;
112 if( PixelWriteConverter )
114 delete PixelWriteConverter;
123 delete HeaderInternal;
128 //-----------------------------------------------------------------------------
130 void File::Print(std::ostream &os)
132 HeaderInternal->SetPrintLevel(PrintLevel);
133 HeaderInternal->Print(os);
135 PixelReadConverter->SetPrintLevel(PrintLevel);
136 PixelReadConverter->Print(os);
139 //-----------------------------------------------------------------------------
142 * \brief Get the size of the image data
144 * If the image can be RGB (with a lut or by default), the size
145 * corresponds to the RGB image
146 * @return The image size
148 size_t File::GetImageDataSize()
150 if ( PixelWriteConverter->GetUserData() )
152 return PixelWriteConverter->GetUserDataSize();
155 return PixelReadConverter->GetRGBSize();
159 * \brief Get the size of the image data
161 * If the image can be RGB by transformation in a LUT, this
162 * transformation isn't considered
163 * @return The raw image size
165 size_t File::GetImageDataRawSize()
167 if ( PixelWriteConverter->GetUserData() )
169 return PixelWriteConverter->GetUserDataSize();
172 return PixelReadConverter->GetRawSize();
176 * \brief - Allocates necessary memory,
177 * - Reads the pixels from disk (uncompress if necessary),
178 * - Transforms YBR pixels, if any, into RGB pixels
179 * - Transforms 3 planes R, G, B, if any, into a single RGB Plane
180 * - Transforms single Grey plane + 3 Palettes into a RGB Plane
181 * - Copies the pixel data (image[s]/volume[s]) to newly allocated zone.
182 * @return Pointer to newly allocated pixel data.
183 * NULL if alloc fails
185 uint8_t *File::GetImageData()
187 if ( PixelWriteConverter->GetUserData() )
189 return PixelWriteConverter->GetUserData();
194 // If the decompression failed nothing can be done.
198 if ( HeaderInternal->HasLUT() && PixelReadConverter->BuildRGBImage() )
200 return PixelReadConverter->GetRGB();
204 // When no LUT or LUT conversion fails, return the Raw
205 return PixelReadConverter->GetRaw();
210 * \brief Allocates necessary memory,
211 * Transforms YBR pixels (if any) into RGB pixels
212 * Transforms 3 planes R, G, B (if any) into a single RGB Plane
213 * Copies the pixel data (image[s]/volume[s]) to newly allocated zone.
214 * DOES NOT transform Grey plane + 3 Palettes into a RGB Plane
215 * @return Pointer to newly allocated pixel data.
216 * \ NULL if alloc fails
218 uint8_t *File::GetImageDataRaw ()
225 * Read the pixels from disk (uncompress if necessary),
226 * Transforms YBR pixels, if any, into RGB pixels
227 * Transforms 3 planes R, G, B, if any, into a single RGB Plane
228 * Transforms single Grey plane + 3 Palettes into a RGB Plane
229 * Copies at most MaxSize bytes of pixel data to caller allocated
231 * \warning This function allows people that want to build a volume
232 * from an image stack *not to* have, first to get the image pixels,
233 * and then move them to the volume area.
234 * It's absolutely useless for any VTK user since vtk chooses
235 * to invert the lines of an image, that is the last line comes first
236 * (for some axis related reasons?). Hence he will have
237 * to load the image line by line, starting from the end.
238 * VTK users have to call GetImageData
240 * @param destination Address (in caller's memory space) at which the
241 * pixel data should be copied
242 * @param maxSize Maximum number of bytes to be copied. When MaxSize
243 * is not sufficient to hold the pixel data the copy is not
244 * executed (i.e. no partial copy).
245 * @return On success, the number of bytes actually copied. Zero on
246 * failure e.g. MaxSize is lower than necessary.
248 size_t File::GetImageDataIntoVector (void *destination, size_t maxSize)
252 // If the decompression failed nothing can be done.
256 if ( HeaderInternal->HasLUT() && PixelReadConverter->BuildRGBImage() )
258 if ( PixelReadConverter->GetRGBSize() > maxSize )
260 gdcmVerboseMacro( "Pixel data bigger than caller's expected MaxSize");
264 (void*)PixelReadConverter->GetRGB(),
265 PixelReadConverter->GetRGBSize() );
266 return PixelReadConverter->GetRGBSize();
269 // Either no LUT conversion necessary or LUT conversion failed
270 if ( PixelReadConverter->GetRawSize() > maxSize )
272 gdcmVerboseMacro( "Pixel data bigger than caller's expected MaxSize");
276 (void*)PixelReadConverter->GetRaw(),
277 PixelReadConverter->GetRawSize() );
278 return PixelReadConverter->GetRawSize();
282 * \brief Points the internal pointer to the callers inData
283 * image representation, BUT WITHOUT COPYING THE DATA.
284 * 'image' Pixels are presented as C-like 2D arrays : line per line.
285 * 'volume'Pixels are presented as C-like 3D arrays : plane per plane
286 * \warning Since the pixels are not copied, it is the caller's responsability
287 * not to deallocate it's data before gdcm uses them (e.g. with
288 * the Write() method.
289 * @param inData user supplied pixel area
290 * @param expectedSize total image size, in Bytes
294 void File::SetImageData(uint8_t *inData, size_t expectedSize)
296 SetUserData(inData,expectedSize);
300 * \brief Set the image datas defined by the user
301 * \warning When writting the file, this datas are get as default datas to write
303 void File::SetUserData(uint8_t *data, size_t expectedSize)
305 PixelWriteConverter->SetUserData(data,expectedSize);
309 * \brief Get the image datas defined by the user
310 * \warning When writting the file, this datas are get as default data to write
312 uint8_t *File::GetUserData()
314 return PixelWriteConverter->GetUserData();
318 * \brief Get the image data size defined by the user
319 * \warning When writting the file, this datas are get as default data to write
321 size_t File::GetUserDataSize()
323 return PixelWriteConverter->GetUserDataSize();
327 * \brief Get the image datas from the file.
328 * If a LUT is found, the data are expanded to be RGB
330 uint8_t *File::GetRGBData()
332 return PixelReadConverter->GetRGB();
336 * \brief Get the image data size from the file.
337 * If a LUT is found, the data are expanded to be RGB
339 size_t File::GetRGBDataSize()
341 return PixelReadConverter->GetRGBSize();
345 * \brief Get the image datas from the file.
346 * If a LUT is found, the datas are not expanded !
348 uint8_t *File::GetRawData()
350 return PixelReadConverter->GetRaw();
354 * \brief Get the image data size from the file.
355 * If a LUT is found, the data are not expanded !
357 size_t File::GetRawDataSize()
359 return PixelReadConverter->GetRawSize();
363 * \brief Writes on disk A SINGLE Dicom file
364 * NO test is performed on processor "Endiannity".
365 * It's up to the user to call his Reader properly
366 * @param fileName name of the file to be created
367 * (any already existing file is over written)
368 * @return false if write fails
371 bool File::WriteRawData(std::string const &fileName)
373 std::ofstream fp1(fileName.c_str(), std::ios::out | std::ios::binary );
376 gdcmVerboseMacro( "Fail to open (write) file:" << fileName.c_str());
380 if( PixelWriteConverter->GetUserData() )
382 fp1.write( (char*)PixelWriteConverter->GetUserData(),
383 PixelWriteConverter->GetUserDataSize() );
385 else if ( PixelReadConverter->GetRGB() )
387 fp1.write( (char*)PixelReadConverter->GetRGB(),
388 PixelReadConverter->GetRGBSize());
390 else if ( PixelReadConverter->GetRaw() )
392 fp1.write( (char*)PixelReadConverter->GetRaw(),
393 PixelReadConverter->GetRawSize());
397 gdcmErrorMacro( "Nothing written." );
406 * \brief Writes on disk A SINGLE Dicom file,
407 * using the Implicit Value Representation convention
408 * NO test is performed on processor "Endiannity".
409 * @param fileName name of the file to be created
410 * (any already existing file is overwritten)
411 * @return false if write fails
414 bool File::WriteDcmImplVR (std::string const &fileName)
416 SetWriteTypeToDcmImplVR();
417 return Write(fileName);
421 * \brief Writes on disk A SINGLE Dicom file,
422 * using the Explicit Value Representation convention
423 * NO test is performed on processor "Endiannity".
424 * @param fileName name of the file to be created
425 * (any already existing file is overwritten)
426 * @return false if write fails
429 bool File::WriteDcmExplVR (std::string const &fileName)
431 SetWriteTypeToDcmExplVR();
432 return Write(fileName);
436 * \brief Writes on disk A SINGLE Dicom file,
437 * using the ACR-NEMA convention
438 * NO test is performed on processor "Endiannity".
439 * (a l'attention des logiciels cliniques
440 * qui ne prennent en entrée QUE des images ACR ...
441 * \warning if a DICOM_V3 header is supplied,
442 * groups < 0x0008 and shadow groups are ignored
443 * \warning NO TEST is performed on processor "Endiannity".
444 * @param fileName name of the file to be created
445 * (any already existing file is overwritten)
446 * @return false if write fails
449 bool File::WriteAcr (std::string const &fileName)
452 return Write(fileName);
456 * \brief Writes on disk A SINGLE Dicom file,
457 * @param fileName name of the file to be created
458 * (any already existing file is overwritten)
459 * @return false if write fails
461 bool File::Write(std::string const &fileName)
466 SetWriteFileTypeToImplicitVR();
469 SetWriteFileTypeToExplicitVR();
473 SetWriteFileTypeToACR();
476 SetWriteFileTypeToExplicitVR();
479 // --------------------------------------------------------------
480 // Special Patch to allow gdcm to re-write ACR-LibIDO formated images
482 // if recognition code tells us we dealt with a LibIDO image
483 // we reproduce on disk the switch between lineNumber and columnNumber
484 // just before writting ...
485 /// \todo the best trick would be *change* the recognition code
486 /// but pb expected if user deals with, e.g. COMPLEX images
487 if( WriteType == ACR_LIBIDO )
493 SetWriteToNoLibido();
495 // ----------------- End of Special Patch ----------------
507 bool check = CheckWriteIntegrity();
510 check = HeaderInternal->Write(fileName,WriteType);
514 RestoreWriteFileType();
516 // --------------------------------------------------------------
517 // Special Patch to allow gdcm to re-write ACR-LibIDO formated images
519 // ...and we restore the Header to be Dicom Compliant again
520 // just after writting
521 RestoreWriteOfLibido();
522 // ----------------- End of Special Patch ----------------
528 * \brief Accesses an existing DocEntry (i.e. a Dicom Element)
529 * through it's (group, element) and modifies it's content with
531 * @param content new value (string) to substitute with
532 * @param group group number of the Dicom Element to modify
533 * @param elem element number of the Dicom Element to modify
535 bool File::SetEntry(std::string const &content,
536 uint16_t group, uint16_t elem)
538 return HeaderInternal->SetEntry(content,group,elem);
543 * \brief Accesses an existing DocEntry (i.e. a Dicom Element)
544 * through it's (group, element) and modifies it's content with
546 * @param content new value (void* -> uint8_t*) to substitute with
547 * @param lgth new value length
548 * @param group group number of the Dicom Element to modify
549 * @param elem element number of the Dicom Element to modify
551 bool File::SetEntry(uint8_t *content, int lgth,
552 uint16_t group, uint16_t elem)
554 return HeaderInternal->SetEntry(content,lgth,group,elem);
558 * \brief Modifies the value of a given Doc Entry (Dicom Element)
559 * when it exists. Create it with the given value when unexistant.
560 * @param content (string) Value to be set
561 * @param group Group number of the Entry
562 * @param elem Element number of the Entry
563 * \return pointer to the modified/created Header Entry (NULL when creation
566 bool File::ReplaceOrCreate(std::string const &content,
567 uint16_t group, uint16_t elem)
569 return HeaderInternal->ReplaceOrCreate(content,group,elem) != NULL;
573 * \brief Modifies the value of a given Header Entry (Dicom Element)
574 * when it exists. Create it with the given value when unexistant.
575 * A copy of the binArea is made to be kept in the Document.
576 * @param binArea (binary) value to be set
577 * @param group Group number of the Entry
578 * @param elem Element number of the Entry
579 * \return pointer to the modified/created Header Entry (NULL when creation
582 bool File::ReplaceOrCreate(uint8_t *binArea, int lgth,
583 uint16_t group, uint16_t elem)
585 return HeaderInternal->ReplaceOrCreate(binArea,lgth,group,elem) != NULL;
589 * \brief Access to the underlying \ref PixelReadConverter RGBA LUT
591 uint8_t* File::GetLutRGBA()
593 return PixelReadConverter->GetLutRGBA();
596 //-----------------------------------------------------------------------------
600 * \brief Check the write integrity
602 * The tests made are :
603 * - verify the size of the image to write with the possible write
604 * when the user set an image data
605 * @return true if the check successfulls
607 bool File::CheckWriteIntegrity()
609 if(PixelWriteConverter->GetUserData())
611 int numberBitsAllocated = HeaderInternal->GetBitsAllocated();
612 if ( numberBitsAllocated == 0 || numberBitsAllocated == 12 )
614 numberBitsAllocated = 16;
617 size_t decSize = HeaderInternal->GetXSize()
618 * HeaderInternal->GetYSize()
619 * HeaderInternal->GetZSize()
620 * ( numberBitsAllocated / 8 )
621 * HeaderInternal->GetSamplesPerPixel();
622 size_t rgbSize = decSize;
623 if( HeaderInternal->HasLUT() )
624 rgbSize = decSize * 3;
629 if( decSize!=PixelWriteConverter->GetUserDataSize() )
631 gdcmVerboseMacro( "Data size is incorrect (Raw)" << decSize
632 << " / " << PixelWriteConverter->GetUserDataSize() );
637 if( rgbSize!=PixelWriteConverter->GetUserDataSize() )
639 gdcmVerboseMacro( "Data size is incorrect (RGB)" << decSize
640 << " / " << PixelWriteConverter->GetUserDataSize() );
650 void File::SetWriteToRaw()
652 if( HeaderInternal->GetNumberOfScalarComponents() == 3
653 && !HeaderInternal->HasLUT())
659 ValEntry *photInt = CopyValEntry(0x0028,0x0004);
660 if(HeaderInternal->HasLUT())
662 photInt->SetValue("PALETTE COLOR ");
666 photInt->SetValue("MONOCHROME1 ");
669 PixelWriteConverter->SetReadData(PixelReadConverter->GetRaw(),
670 PixelReadConverter->GetRawSize());
673 CopyBinEntry(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel());
674 pixel->SetValue(GDCM_BINLOADED);
675 pixel->SetBinArea(PixelWriteConverter->GetData(),false);
676 pixel->SetLength(PixelWriteConverter->GetDataSize());
678 Archive->Push(photInt);
679 Archive->Push(pixel);
683 void File::SetWriteToRGB()
685 if(HeaderInternal->GetNumberOfScalarComponents()==3)
687 PixelReadConverter->BuildRGBImage();
689 ValEntry *spp = CopyValEntry(0x0028,0x0002);
692 ValEntry *planConfig = CopyValEntry(0x0028,0x0006);
693 planConfig->SetValue("0 ");
695 ValEntry *photInt = CopyValEntry(0x0028,0x0004);
696 photInt->SetValue("RGB ");
698 if(PixelReadConverter->GetRGB())
700 PixelWriteConverter->SetReadData(PixelReadConverter->GetRGB(),
701 PixelReadConverter->GetRGBSize());
705 PixelWriteConverter->SetReadData(PixelReadConverter->GetRaw(),
706 PixelReadConverter->GetRawSize());
710 CopyBinEntry(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel());
711 pixel->SetValue(GDCM_BINLOADED);
712 pixel->SetBinArea(PixelWriteConverter->GetData(),false);
713 pixel->SetLength(PixelWriteConverter->GetDataSize());
716 Archive->Push(planConfig);
717 Archive->Push(photInt);
718 Archive->Push(pixel);
721 Archive->Push(0x0028,0x1101);
722 Archive->Push(0x0028,0x1102);
723 Archive->Push(0x0028,0x1103);
724 Archive->Push(0x0028,0x1201);
725 Archive->Push(0x0028,0x1202);
726 Archive->Push(0x0028,0x1203);
729 // Thus, we have a RGB image and the bits allocated = 24 and
730 // samples per pixels = 1 (in the read file)
731 if(HeaderInternal->GetBitsAllocated()==24)
733 ValEntry *bitsAlloc = CopyValEntry(0x0028,0x0100);
734 bitsAlloc->SetValue("8 ");
736 ValEntry *bitsStored = CopyValEntry(0x0028,0x0101);
737 bitsStored->SetValue("8 ");
739 ValEntry *highBit = CopyValEntry(0x0028,0x0102);
740 highBit->SetValue("7 ");
742 Archive->Push(bitsAlloc);
743 Archive->Push(bitsStored);
744 Archive->Push(highBit);
753 void File::RestoreWrite()
755 Archive->Restore(0x0028,0x0002);
756 Archive->Restore(0x0028,0x0004);
757 Archive->Restore(0x0028,0x0006);
758 Archive->Restore(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel());
760 // For old ACR-NEMA (24 bits problem)
761 Archive->Restore(0x0028,0x0100);
762 Archive->Restore(0x0028,0x0101);
763 Archive->Restore(0x0028,0x0102);
766 Archive->Restore(0x0028,0x1101);
767 Archive->Restore(0x0028,0x1102);
768 Archive->Restore(0x0028,0x1103);
769 Archive->Restore(0x0028,0x1201);
770 Archive->Restore(0x0028,0x1202);
771 Archive->Restore(0x0028,0x1203);
774 void File::SetWriteFileTypeToACR()
776 Archive->Push(0x0002,0x0010);
779 void File::SetWriteFileTypeToExplicitVR()
781 std::string ts = Util::DicomString(
782 Global::GetTS()->GetSpecialTransferSyntax(TS::ExplicitVRLittleEndian) );
784 ValEntry *tss = CopyValEntry(0x0002,0x0010);
790 void File::SetWriteFileTypeToImplicitVR()
792 std::string ts = Util::DicomString(
793 Global::GetTS()->GetSpecialTransferSyntax(TS::ImplicitVRLittleEndian) );
795 ValEntry *tss = CopyValEntry(0x0002,0x0010);
801 void File::RestoreWriteFileType()
803 Archive->Restore(0x0002,0x0010);
806 void File::SetWriteToLibido()
808 ValEntry *oldRow = dynamic_cast<ValEntry *>
809 (HeaderInternal->GetDocEntry(0x0028, 0x0010));
810 ValEntry *oldCol = dynamic_cast<ValEntry *>
811 (HeaderInternal->GetDocEntry(0x0028, 0x0011));
813 if( oldRow && oldCol )
815 std::string rows, columns;
817 ValEntry *newRow=new ValEntry(oldRow->GetDictEntry());
818 ValEntry *newCol=new ValEntry(oldCol->GetDictEntry());
820 newRow->Copy(oldCol);
821 newCol->Copy(oldRow);
823 newRow->SetValue(oldCol->GetValue());
824 newCol->SetValue(oldRow->GetValue());
826 Archive->Push(newRow);
827 Archive->Push(newCol);
830 ValEntry *libidoCode = CopyValEntry(0x0008,0x0010);
831 libidoCode->SetValue("ACRNEMA_LIBIDO_1.1");
832 Archive->Push(libidoCode);
835 void File::SetWriteToNoLibido()
837 ValEntry *recCode = dynamic_cast<ValEntry *>
838 (HeaderInternal->GetDocEntry(0x0008,0x0010));
841 if( recCode->GetValue() == "ACRNEMA_LIBIDO_1.1" )
843 ValEntry *libidoCode = CopyValEntry(0x0008,0x0010);
844 libidoCode->SetValue("");
845 Archive->Push(libidoCode);
850 void File::RestoreWriteOfLibido()
852 Archive->Restore(0x0028,0x0010);
853 Archive->Restore(0x0028,0x0011);
854 Archive->Restore(0x0008,0x0010);
857 ValEntry *File::CopyValEntry(uint16_t group,uint16_t elem)
859 DocEntry *oldE = HeaderInternal->GetDocEntry(group, elem);
864 newE = new ValEntry(oldE->GetDictEntry());
869 newE = GetHeader()->NewValEntry(group,elem);
875 BinEntry *File::CopyBinEntry(uint16_t group,uint16_t elem)
877 DocEntry *oldE = HeaderInternal->GetDocEntry(group, elem);
882 newE = new BinEntry(oldE->GetDictEntry());
887 newE = GetHeader()->NewBinEntry(group,elem);
893 //-----------------------------------------------------------------------------
896 * \brief Factorization for various forms of constructors.
898 void File::Initialise()
900 WriteMode = WMODE_RAW;
901 WriteType = ExplicitVR;
903 PixelReadConverter = new PixelReadConvert;
904 PixelWriteConverter = new PixelWriteConvert;
905 Archive = new DocEntryArchive( HeaderInternal );
907 if ( HeaderInternal->IsReadable() )
909 PixelReadConverter->GrabInformationsFromHeader( HeaderInternal );
913 uint8_t *File::GetRaw()
915 uint8_t *raw = PixelReadConverter->GetRaw();
918 // The Raw image migth not be loaded yet:
919 std::ifstream *fp = HeaderInternal->OpenFile();
920 PixelReadConverter->ReadAndDecompressPixelData( fp );
922 HeaderInternal->CloseFile();
924 raw = PixelReadConverter->GetRaw();
927 gdcmVerboseMacro( "Read/decompress of pixel data apparently went wrong.");
935 //-----------------------------------------------------------------------------
938 //-----------------------------------------------------------------------------
939 } // end namespace gdcm