+ * \warning if a DICOM_V3 header is supplied,
+ * groups < 0x0008 and shadow groups are ignored
+ * \warning NO TEST is performed on processor "Endiannity".
+ * @param fileName name of the file to be created
+ * (any already existing file is overwritten)
+ * @return false if write fails
+ */
+
+bool File::WriteAcr (std::string const & fileName)
+{
+ SetWriteTypeToAcr();
+ return Write(fileName);
+}
+
+bool File::Write(std::string const& fileName)
+{
+ return WriteBase(fileName);
+}
+
+bool File::SetEntryByNumber(std::string const& content,
+ uint16_t group, uint16_t element)
+{
+ return HeaderInternal->SetEntryByNumber(content,group,element);
+}
+
+bool File::SetEntryByNumber(uint8_t* content, int lgth,
+ uint16_t group, uint16_t element)
+{
+ return HeaderInternal->SetEntryByNumber(content,lgth,group,element);
+}
+
+bool File::ReplaceOrCreateByNumber(std::string const& content,
+ uint16_t group, uint16_t element)
+{
+ return HeaderInternal->ReplaceOrCreateByNumber(content,group,element) != NULL;
+}
+
+bool File::ReplaceOrCreateByNumber(uint8_t* binArea, int lgth,
+ uint16_t group, uint16_t element)
+{
+ return HeaderInternal->ReplaceOrCreateByNumber(binArea,lgth,group,element) != NULL;
+}
+
+/**
+ * \brief Access to the underlying \ref PixelReadConverter RGBA LUT
+ */
+uint8_t* File::GetLutRGBA()
+{
+ return PixelReadConverter->GetLutRGBA();
+}
+
+//-----------------------------------------------------------------------------
+// Protected
+/**
+ * \brief NOT a end user inteded function
+ * (used by WriteDcmExplVR, WriteDcmImplVR, WriteAcr, etc)
+ * @param fileName name of the file to be created
+ * (any already existing file is overwritten)
+ * @param type file type (ExplicitVR, ImplicitVR, ...)
+ * @return false if write fails
+ */
+bool File::WriteBase (std::string const & fileName)
+{
+ switch(WriteType)
+ {
+ case ImplicitVR:
+ SetWriteFileTypeToImplicitVR();
+ break;
+ case ExplicitVR:
+ SetWriteFileTypeToExplicitVR();
+ break;
+ case ACR:
+ case ACR_LIBIDO:
+ SetWriteFileTypeToACR();
+ break;
+ default:
+ SetWriteFileTypeToExplicitVR();
+ }
+
+ // --------------------------------------------------------------
+ // Special Patch to allow gdcm to re-write ACR-LibIDO formated images
+ //
+ // if recognition code tells us we dealt with a LibIDO image
+ // we reproduce on disk the switch between lineNumber and columnNumber
+ // just before writting ...
+ /// \todo the best trick would be *change* the recognition code
+ /// but pb expected if user deals with, e.g. COMPLEX images
+ if( WriteType == ACR_LIBIDO )
+ {
+ SetWriteToLibido();
+ }
+ else
+ {
+ SetWriteToNoLibido();
+ }
+ // ----------------- End of Special Patch ----------------
+
+ switch(WriteMode)
+ {
+ case WMODE_RAW :
+ SetWriteToRaw();
+ break;
+ case WMODE_RGB :
+ SetWriteToRGB();
+ break;
+ }
+
+ bool check = CheckWriteIntegrity();
+ if(check)
+ {
+ check = HeaderInternal->Write(fileName,WriteType);
+ }
+
+ RestoreWrite();
+ RestoreWriteFileType();
+
+ // --------------------------------------------------------------
+ // Special Patch to allow gdcm to re-write ACR-LibIDO formated images
+ //
+ // ...and we restore the Header to be Dicom Compliant again
+ // just after writting
+ RestoreWriteOfLibido();
+ // ----------------- End of Special Patch ----------------
+
+ return check;
+}
+
+/**
+ * \brief Check the write integrity