From: jean-pierre roux Date: Tue, 12 Jan 2010 15:17:34 +0000 (+0000) Subject: RECO_* vs PVM_* X-Git-Tag: CREATOOLS.2-0-3~27 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=creaBruker.git;a=commitdiff_plain;h=dd3ea68dd3fb6fe839441dca52f5301d36a18786 RECO_* vs PVM_* --- diff --git a/lib/src1/bruker2dicom.cxx b/lib/src1/bruker2dicom.cxx index 34a5ea0..4f8cd20 100644 --- a/lib/src1/bruker2dicom.cxx +++ b/lib/src1/bruker2dicom.cxx @@ -449,7 +449,7 @@ void Bruker2Dicom::DealWithNiveau2(std::string level2Directory, std::string curr GDCM_NAME_SPACE::Util::GetName(*it).c_str(), str_isa_func_name.c_str()); } - try { + try { DealWithNiveau3(*it, outputDirName); } catch (BrukerHopelessException &e) @@ -463,7 +463,7 @@ void Bruker2Dicom::DealWithNiveau2(std::string level2Directory, std::string curr std::cout << "And Init Exception was thrown in DealWithNiveau3 (" << e.what() << "); " << " We skip [" << level2Directory << "]" << std::endl; continue; - } + } } } } @@ -487,7 +487,7 @@ void Bruker2Dicom::DealWithNiveau3(std::string level3Directory, std::string curr if (!res) { std::cout << "[" << currentOutputDirName << "] Directory creation failure " << std::endl; - throw ( BrukerHopelessException ("Hopeless! Level3 output directory creation failure")); + throw ( BrukerHopelessException ("Hopeless! Level3 output directory creation failure")); //exit (0); } @@ -507,12 +507,12 @@ void Bruker2Dicom::DealWithNiveau3(std::string level3Directory, std::string curr char copyFile[PATH_MAX + PATH_MAX + 5]; // Should be enough! bool canOpen; - + //-------------- try d3proc; char char_d3proc[(unsigned int) PATH_MAX+2]; sprintf(char_d3proc,"%s%c%s", level3Directory.c_str(), GDCM_NAME_SPACE::GDCM_FILESEPARATOR,"d3proc" ); - + if (verbose) std::cout << "d3proc: --- => [" << char_d3proc << "]" << std::endl; std::string str_d3proc(char_d3proc); @@ -532,10 +532,10 @@ void Bruker2Dicom::DealWithNiveau3(std::string level3Directory, std::string curr throw ( BrukerHopelessException ("Hopeless! FillMap failed on 'd3proc'")); //exit(0); /// \TODO throw an exception ! } - + //-------------- end try d3proc; - - + + // -------------------try reco char char_reco[(unsigned int) PATH_MAX+2]; @@ -590,16 +590,16 @@ void Bruker2Dicom::DealWithNiveau3(std::string level3Directory, std::string curr if (verbose) std::cout << "IM_SIY " << NY << std::endl; /// \todo : check if there are actually 3 dimensions or only 2 - + BrukerFieldData bZ= br_d3proc.GetFieldData("IM_SIZ"); int nbFrames = bZ.GetIntValue()[0]; if (verbose) std::cout << "IM_SIZ " << nbFrames << std::endl; // WARNING DATTYPE is, either in {ip_short, ip_int, ip_char, ...}, or in {1, 2, 3, ...} - + BrukerFieldData bDPT = br_d3proc.GetFieldData("DATTYPE"); - + std::string mhdDataPixelType; int pixelSize; getImhDataType(bDPT, mhdDataPixelType, pixelSize); @@ -623,9 +623,11 @@ void Bruker2Dicom::DealWithNiveau3(std::string level3Directory, std::string curr double spatResolY = spatResol.GetDoubleValue()[1]; if (verbose) std::cout << "SpatResol (ds method) " << spatResolX << " " << spatResolY << std::endl; + BrukerFieldData bsliceDistance = br_method.GetFieldData("PVM_SPackArrSliceDistance"); + + double sliceDistance = bsliceDistance.GetDoubleValue()[0]; */ - // Better we use 'get' accessors from BrukerImage class, as Denis wrote them BrukerFieldData fov = br_reco.GetFieldData("RECO_Fov"); @@ -634,7 +636,7 @@ void Bruker2Dicom::DealWithNiveau3(std::string level3Directory, std::string curr if (verbose) std::cout << "FOV (ds method) " << fovX << " " << fovY << std::endl; - BrukerFieldData spatResol = br_reco.GetFieldData("PVM_SpatResol"); + BrukerFieldData spatResol = br_reco.GetFieldData("RECO_SpatResol"); double spatResolX = spatResol.GetDoubleValue()[0]; double spatResolY = spatResol.GetDoubleValue()[1]; if (verbose) @@ -642,9 +644,12 @@ void Bruker2Dicom::DealWithNiveau3(std::string level3Directory, std::string curr /// \TODO probabely a more sophisticated accessor will be necessary : /// (cf : non contiguous slices, overlapping, slice thickness, space between slices, etc) - BrukerFieldData bsliceDistance = br_method.GetFieldData("PVM_SPackArrSliceDistance"); + + BrukerFieldData bsliceDistance = br_method.GetFieldData("RECO_SPackArrSliceDistance"); double sliceDistance = bsliceDistance.GetDoubleValue()[0]; +// ---------------------------------------------------------------------------------------- + if (mhd) { sprintf(currentOutputMhdDirName, "%s%c%s", currentOutputDirName.c_str(),