Program: gdcm
Module: $RCSfile: PhilipsToBrucker2.cxx,v $
Language: C++
- Date: $Date: 2006/01/31 15:28:54 $
- Version: $Revision: 1.13 $
+ Date: $Date: 2006/03/17 14:36:37 $
+ Version: $Revision: 1.20 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
" - orders the gdcm-readable found Files according to their ",
" (0x0010, 0x0010) Patient's Name ",
" (0x0020, 0x000e) Series Instance UID ",
- " (0x0020, 0x0032) Image Position (Patient) ",
+ " (0x0020, 0x0032)PhilipsToBrucker2. Image Position (Patient) ",
" (0x0018, 0x1060) Trigger Time ",
- " (0x0018, 0x1312) In-plane Phase Encoding Direction ",
+ " (0x0018, 0x1312) In-pl)ane Phase Encoding Direction ",
" - fills a single level (*) Directory with *all* the files, ",
" converted into a Brucker-like Dicom, InTags compliant ",
" (*) actually : creates as many directories as Patients ",
<< std::endl;
std::string uniqueSeriesIdentifier;
- for (gdcm::DirListType::iterator it = fileNames.begin();
+ for (gdcm::DirListType::iterator it) = fileNames.begin();
it != fileNames.end();
++it)
{
tokens[3] = newName;
tokensForFileName.clear();
}
- else
+ else
tokens[3] = name;
userFileIdentifier = tokens[0] + token + tokens[1] + token + tokens[2] + token
+ tokens[3] + token + tokens[4] + token;
}
-
- std::cout << " [" <<
- userFileIdentifier << "]" << std::endl;
+ if (verbose)
+ std::cout << "[" << userFileIdentifier << "]" << std::endl;
// storing in a map ensures automatic sorting !
sf[userFileIdentifier] = f;
fullFilename = currentFile->GetFileName();
lastFilename = gdcm::Util::GetName( fullFilename );
- std::cout << "Try to write [" <<lastFilename << "]" << std::endl;
+ std::cout << "Rewrite [" <<lastFilename << "]" << std::endl;
tokens.clear();
gdcm::Util::Tokenize (it2->first, tokens, token);
if (currentFile->IsVRCoherent(0x0021) == 1 )
stringVR = " ";
else
- stringVR = "IS";
+ stringVR = "IS";
+
currentFile->InsertEntryString(strChSliceIndex, 0x0021, 0x1020, stringVR);
currentFile->InsertEntryString(chFrameIndex, 0x0021, 0x1040, stringVR);
-
- if (flag == 0)
- {
- flag = 1;
- }
- else
- {
+
+ if (taggrid)
frameIndex++;
- flag = 0;
- }
-
+ else
+ {
+ if (flag == 0)
+ {
+ flag = 1;
+ }
+ else
+ {
+ frameIndex++;
+ flag = 0;
+ }
+ }
+
if (split)
//fullWriteFilename = currentPhaseEncodingDirectionWriteDir + gdcm::GDCM_FILESEPARATOR
fh = gdcm::FileHelper::New(currentFile);
fh->GetImageDataRaw(); // Don't convert (Gray Pixels + LUT) into (RGB pixels) ?!?
fh->SetWriteTypeToDcmExplVR();
+ // We didn't modify pixels -> keep unchanged the following :
+ // 'Media Storage SOP Class UID' (0x0002,0x0002)
+ // 'SOP Class UID' (0x0008,0x0016)
+ // 'Image Type' (0x0008,0x0008)
+ // 'Conversion Type' (0x0008,0x0064)
+ fh->SetContentType(gdcm::UNMODIFIED_PIXELS_IMAGE);
if (!fh->Write(fullWriteFilename))
{
std::cout << "Fail to write :[" << fullWriteFilename << "]"