From: jean-pierre roux Date: Tue, 18 May 2010 12:28:37 +0000 (+0000) Subject: Add Bruker 'Perfusion' info to dicom header X-Git-Tag: CREATOOLS.2-0-3~7 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=creaBruker.git;a=commitdiff_plain;h=7b7bbcd11996dd24d3b670c2befb7cdad14310b5 Add Bruker 'Perfusion' info to dicom header --- diff --git a/lib/src1/bruker2dicom.cxx b/lib/src1/bruker2dicom.cxx index e241166..0c8dbe5 100644 --- a/lib/src1/bruker2dicom.cxx +++ b/lib/src1/bruker2dicom.cxx @@ -1554,6 +1554,93 @@ std::cout << "charImageOrientation " << imageSet[imgNum].getTranslationVectorRPS2XYZ()[2]); file->InsertEntryString(charImagePosition,0x0020,0x0032, "DS"); //0020 0032 DS 3 Image Position (Patient) + + + // Private creator + /* + +0029|0010 [LO] [Private Creator] [CREATIS HEADER ] +0029|0011 [LO] [Private Creator] [CREATIS for BRUKER to DICOM] +0029|1031 [LO] [] [4.0.7571167 ] +0029|1032 [UL] [] [1440000] =0x(15f900) + +> $$ Thu Jul 30 17:29:46 2009 CEST (UT+2h) mwiart +> $$ /opt/PV4.0/data/mwiart/nmr/dha80.Uw1/4/method +> ##$Method=DtiEpi +> ##$PVM_DwNDiffDir=3 % 3 directions +> ##$PVM_DwNDiffExpEach=2 % 2 valeurs de b par direction +> ##$PVM_DwAoImages=1 % 1 image pour b=0 +> ##$PVM_DwBvalEach=( 2 ) % Valeurs de b +> 1500.000000 3000.000000 +> +> $$ Wed Dec 2 09:56:01 2009 UTC (UT+0h) mwiart +> $$ /opt/Pv5.0/data/mwiart/nmr/ECI7.Wx1/4/method +> ##$Method=DtiEpi +> ##$PVM_DwNDiffDir=3 % 3 directions +> ##$PVM_DwNDiffExpEach=2 % 2 valeurs de b par direction +> ##$PVM_DwAoImages=1 % 1 image pour b=0 +> ##$PVM_DwBvalEach=( 2 ) % Valeurs de b +> 1500 3000 +> +> $$ Wed Dec 2 10:14:27 2009 UTC (UT+0h) mwiart +> $$ /opt/Pv5.0/data/mwiart/nmr/ECI7.Wx1/5/method +> ##$Method=DtiStandard +> ##$PVM_DwNDiffDir=1 % 1 direction +> ##$PVM_DwNDiffExpEach=2 % 2 valeurs de b +> ##$PVM_DwAoImages=0 % 0 image pour b=0 +> ##$PVM_DwBvalEach=( 2 ) % Valeurs de b +> 138 1600 +> + */ + + file->InsertEntryString("CREATIS HEADER", 0x0029,0x0010, "LO"); + file->InsertEntryString("CREATIS FOR BRUKER-TO-DICOM", 0x0029,0x0011, "LO"); + + BrukerFieldData brf_method = br_method.GetFieldData("Method"); + const std::vector method = brf_method.GetStringValue(); + + // std::string method = br_method.GetFieldData("Method").GetStringValue(); + file->InsertEntryString(method[0], 0x0029,0x0100, "LO"); + + std::cout << " method[" << method[0] << "]" << std::endl; + if (method[0] == "DtiEpi" || method[0] == "DtiStandard") + { + // const std::vector NDiffDir = br_method.GetFieldData("PVM_DwNDiffDir").GetIntValue(); + BrukerFieldData brf_NDiffDir = br_method.GetFieldData("PVM_DwNDiffDir"); + const std::vector NDiffDir = brf_NDiffDir.GetIntValue(); + + //const std::vector NDiffExpEach = br_method.GetFieldData("PVM_DwNDiffExpEach").GetIntValue(); + BrukerFieldData brf_NDiffExpEach = br_method.GetFieldData("PVM_DwNDiffExpEach"); + const std::vector NDiffExpEach =brf_NDiffExpEach.GetIntValue(); + +// const std::vector AoImages = br_method.GetFieldData("PVM_DwAoImages").GetIntValue(); + BrukerFieldData brf_AoImages = br_method.GetFieldData("PVM_DwAoImages"); + const std::vector AoImages = brf_AoImages.GetIntValue(); + + BrukerFieldData brf_DwBvalEach = br_method.GetFieldData("PVM_DwBvalEach"); + const std::vector DwBvalEach = brf_DwBvalEach.GetDoubleValue(); + + std::cout << "nb directions : " << NDiffDir[0] << " nb valeurs de b par direction : " << NDiffExpEach[0] + << " nb images for b=0 : " << AoImages[0] << std::endl; + + str.str(""); + str << NDiffDir[0]; + file->InsertEntryString(str.str(),0x0029,0x0101,"US"); // directions + str.str(""); + str << NDiffExpEach[0]; + file->InsertEntryString(str.str(),0x0029,0x0102,"US"); // valeurs de b par direction + str.str(""); + str << AoImages[0]; + file->InsertEntryString(str.str(),0x0029,0x0103,"US"); // image pour b=0 + + str.str(""); + for (unsigned int i=0; iInsertEntryString(str.str(),0x0029,0x0104,"DS"); // Valeurs de b + } // 0020 0x1041 DS 1 Slice Location // sprintf(charImagePosition,"%f",float(imgNum)); diff --git a/lib/src1/bruker2dicom.h b/lib/src1/bruker2dicom.h index 3146026..6d6b9d4 100644 --- a/lib/src1/bruker2dicom.h +++ b/lib/src1/bruker2dicom.h @@ -86,7 +86,6 @@ void dealWithCarto(GDCM_NAME_SPACE::DirListType &fileNames, int NX, int NY, int double fovX, double fovY, double sliceDistance, char *copyFile, std::string ¤tOutputDirName, char *outputMhdFileName, char *output2dseqCartoName); - public: // these ones are for debugging only