+ // Transform the image to be 'Brucker-Like'
+ // ----------------------------------------
+
+ // Deal with 0x0019, 0x1000 : 'FOV'
+ int nX = currentFile->GetXSize();
+ int nY = currentFile->GetYSize();
+ float pxSzX = currentFile->GetXSpacing();
+ float pxSzY = currentFile->GetYSpacing();
+ char fov[64];
+ sprintf(fov, "%f\\%f",nX*pxSzX, nY*pxSzY);
+ currentFile->InsertEntryString(fov, 0x0019, 0x1000, "DS");
+
+ // Deal with 0x0020, 0x0012 : 'SESSION INDEX'
+ std::string chSessionIndex;
+ if (currentPhaseEncodingDirection == "ROW")
+ chSessionIndex = "1";
+ else
+ chSessionIndex = "2"; // suppose it's "COLUMN" !
+ currentFile->InsertEntryString(chSessionIndex, 0x0020, 0x0012, "IS");
+
+ // Deal with 0x0021, 01020 : 'SLICE INDEX'
+ char chSliceIndex[5];
+ sprintf(chSliceIndex, "%04d", sliceIndex);
+ std::string strChSliceIndex(chSliceIndex);
+ currentFile->InsertEntryString(strChSliceIndex, 0x0021, 0x1020, "IS");
+
+ // Deal with 0x0021, 01040 : 'FRAME INDEX'
+ char chFrameIndex[5];
+ sprintf(chFrameIndex, "%04d", frameIndex);
+ currentFile->InsertEntryString(chFrameIndex, 0x0021, 0x1040, "IS");
+
+ std::string strExtent(extent);
+ std::string fullWriteFilename = currentWriteDir + gdcm::GDCM_FILESEPARATOR + lastFilename + strExtent;
+
+ /*
+ systemCommand = "cp " + fullFilename + " " + fullWriteFilename;
+ std::cout << systemCommand << std::endl;
+ system ( systemCommand.c_str() );
+ */
+
+ // Load the pixels in RAM.
+
+ fh = gdcm::FileHelper::New(currentFile);
+ fh->GetImageDataRaw(); // Don't convert (Gray Pixels + LUT) into (RGB pixels) ?!?
+ fh->SetWriteTypeToDcmExplVR();
+ fh->Write(fullWriteFilename);
+ fh->Delete();