From: jpr Date: Fri, 21 Oct 2005 16:02:01 +0000 (+0000) Subject: Comments X-Git-Tag: OpenJPEG.Version1.2~241 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=61b33e5e4541969c12c462a5ddec3be4f4751cea;p=gdcm.git Comments --- diff --git a/src/gdcmDicomDir.cxx b/src/gdcmDicomDir.cxx index 8e366624..ee3fb0eb 100644 --- a/src/gdcmDicomDir.cxx +++ b/src/gdcmDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/10/21 12:12:55 $ - Version: $Revision: 1.163 $ + Date: $Date: 2005/10/21 16:02:01 $ + Version: $Revision: 1.164 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -125,18 +125,18 @@ DicomDir::DicomDir() } #ifndef GDCM_LEGACY_REMOVE -/** - * \brief Constructor Parses recursively the directory and creates the DicomDir +/* * + * \ brief Constructor Parses recursively the directory and creates the DicomDir * or uses an already built DICOMDIR, depending on 'parseDir' value. - * @param fileName name + * @ param fileName name * - of the root directory (parseDir = true) * - of the DICOMDIR (parseDir = false) - * @param parseDir boolean + * @ param parseDir boolean * - true if user passed an entry point * and wants to explore recursively the directories * - false if user passed an already built DICOMDIR file * and wants to use it - * @deprecated use : new DicomDir() + [ SetLoadMode(lm) + ] SetDirectoryName(name) + * @ deprecated use : new DicomDir() + [ SetLoadMode(lm) + ] SetDirectoryName(name) * or : new DicomDir() + SetFileName(name) */ DicomDir::DicomDir(std::string const &fileName, bool parseDir ): @@ -190,12 +190,12 @@ bool DicomDir::Load( ) } #ifndef GDCM_LEGACY_REMOVE -/** - * \brief Loader. (DEPRECATED : kept not to break the API) - * @param fileName file to be open for parsing - * @return false if file cannot be open or no swap info was found, +/* * + * \ brief Loader. (DEPRECATED : kept not to break the API) + * @ param fileName file to be open for parsing + * @ return false if file cannot be open or no swap info was found, * or no tag was found. - * @deprecated use SetFileName(n) + Load() instead + * @ deprecated use SetFileName(n) + Load() instead */ bool DicomDir::Load(std::string const &fileName ) { diff --git a/src/gdcmFileHelper.cxx b/src/gdcmFileHelper.cxx index 341a140b..147c289a 100644 --- a/src/gdcmFileHelper.cxx +++ b/src/gdcmFileHelper.cxx @@ -4,8 +4,8 @@ Module: $RCSfile: gdcmFileHelper.cxx,v $ Language: C++ - Date: $Date: 2005/10/21 12:06:06 $ - Version: $Revision: 1.67 $ + Date: $Date: 2005/10/21 16:02:01 $ + Version: $Revision: 1.68 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -161,20 +161,20 @@ FileHelper::FileHelper(File *header) } #ifndef GDCM_LEGACY_REMOVE -/** - * \brief DEPRECATED : use SetFilename() + SetLoadMode() + Load() methods +/* * + * \ brief DEPRECATED : use SetFilename() + SetLoadMode() + Load() methods * Constructor dedicated to deal with the *pixels* area of a ACR/DICOMV3 * file (gdcm::File only deals with the ... header) * Opens (in read only and when possible) an existing file and checks * for DICOM compliance. Returns NULL on failure. * It will be up to the user to load the pixels into memory - * \note the in-memory representation of all available tags found in + * \ note the in-memory representation of all available tags found in * the DICOM header is post-poned to first header information access. * This avoid a double parsing of public part of the header when * one sets an a posteriori shadow dictionary (efficiency can be * seen as a side effect). - * @param filename file to be opened for parsing - * @deprecated use SetFilename() + Load() methods + * @ param filename file to be opened for parsing + * @ deprecated use SetFilename() + Load() methods */ FileHelper::FileHelper(std::string const &filename ) { @@ -415,8 +415,8 @@ uint8_t *FileHelper::GetImageDataRaw () } #ifndef GDCM_LEGACY_REMOVE -/** - * \brief Useless function, since PixelReadConverter forces us +/* * + * \ brief Useless function, since PixelReadConverter forces us * copy the Pixels anyway. * Reads the pixels from disk (uncompress if necessary), * Transforms YBR pixels, if any, into RGB pixels @@ -424,7 +424,7 @@ uint8_t *FileHelper::GetImageDataRaw () * Transforms single Grey plane + 3 Palettes into a RGB Plane * Copies at most MaxSize bytes of pixel data to caller allocated * memory space. - * \warning This function allows people that want to build a volume + * \ warning This function allows people that want to build a volume * from an image stack *not to* have, first to get the image pixels, * and then move them to the volume area. * It's absolutely useless for any VTK user since vtk chooses @@ -433,12 +433,12 @@ uint8_t *FileHelper::GetImageDataRaw () * to load the image line by line, starting from the end. * VTK users have to call GetImageData * - * @param destination Address (in caller's memory space) at which the + * @ param destination Address (in caller's memory space) at which the * pixel data should be copied - * @param maxSize Maximum number of bytes to be copied. When MaxSize + * @ param maxSize Maximum number of bytes to be copied. When MaxSize * is not sufficient to hold the pixel data the copy is not * executed (i.e. no partial copy). - * @return On success, the number of bytes actually copied. Zero on + * @ return On success, the number of bytes actually copied. Zero on * failure e.g. MaxSize is lower than necessary. */ size_t FileHelper::GetImageDataIntoVector (void *destination, size_t maxSize) diff --git a/src/gdcmOrientation.cxx b/src/gdcmOrientation.cxx index d23402ca..ed2e0489 100644 --- a/src/gdcmOrientation.cxx +++ b/src/gdcmOrientation.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmOrientation.cxx,v $ Language: C++ - Date: $Date: 2005/10/18 08:35:50 $ - Version: $Revision: 1.17 $ + Date: $Date: 2005/10/21 16:02:01 $ + Version: $Revision: 1.18 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -204,146 +204,6 @@ Orientation::ProductVectorial(vector3D const &vec1, vector3D const &vec2) } - -// --------------------------------------------------------------------------- -// Here is the original Python code, kindly supplied by THERALYS -// -// C++ code doesn't give good results -// --> FIXME - -/* - -def TypeOrientation(self,file0): -""" -# ------------------------- Purpose : ----------------------------------- -# - This function compare the orientation of the given image and the -# basics orientations (Axial, Cornal, Sagital) -# ------------------------- Parameters : -------------------------------- -# - : - type : string -# - The name of the first image file of the serie -# ------------------------- Return : ------------------------------------ -# 1 : Axial -# -1 : Axial invert -# 2 : Coronal -# -2 : Coronal invert -# 3 : Sagital -# -3 : Sagital invert -# 4 : Heart Axial -# -4 : Heart Axial invert -# 5 : Heart Coronal -# -5 : Heart Coronal invert -# 6 : Heart Sagital -# -6 : Heart Sagital invert -# - # ------------------------- Other : ------------------------------------- -# This method finds the most similar basic orientation. -""" -try: - toRead = gdcm.File(file0) - ValDict = GetValuesDict(toRead) - try: - imageOrientation=ValDict["Image Orientation (Patient)"] - except KeyError: - imageOrientation=ValDict["Image Orientation"] - - ori1=[float(split(imageOrientation,"\\")[0]),\ - float(split(imageOrientation,"\\")[1]),\ - float(split(imageOrientation,"\\")[2])] - ori2=[float(split(imageOrientation,"\\")[3]),\ - float(split(imageOrientation,"\\")[4]),\ - float(split(imageOrientation,"\\")[5])] - -## two vectors perpendicular describe one plane - dicPlane=[ [ [1,0,0],[0,1,0] ], ## Axial - [ [1,0,0],[0,0,-1] ], ## Coronal - [ [0,1,0],[0,0,-1] ], ## Sagittal - [ [ 0.8 , 0.5 , 0.0 ],[-0.1 , 0.1 , -0.95] ],## Axial - HEART - [ [ 0.8 , 0.5 , 0.0 ],[-0.6674 , 0.687 , 0.1794] ],## Coronal - HEART - [ [-0.1 , 0.1 , -0.95],[-0.6674 , 0.687 , 0.1794] ] ] ## Sagittal - HEART - - i=0 - res=[0,99999] ## [ , ] - for plane in dicPlane: - i=i+1 - refA=plane[0] - refB=plane[1] - res=self.VerfCriterion( i , self.CalculLikelyhood2Vec(refA,refB,ori1,ori2) , res ) - res=self.VerfCriterion( -i , self.CalculLikelyhood2Vec(refB,refA,ori1,ori2) , res ) - return res[0] - - except KeyError: - return 0 - - - def VerfCriterion(self,typeCriterion,criterionNew,res): - type = res[0] - criterion = res[1] -# if criterionNew<0.1 and criterionNew : - type : vector 3D (float) - # - : - type : vector 3D (float) - # - Description of the first plane - # - : - type : vector 3D (float) - # - : - type : vector 3D (float) - # - Description of the second plane - # ------------------------- Return : ------------------------------------ - # float : 0 if the planes are perpendicular. - # While the difference of the orientation between the planes - # are big more enlarge is - # the criterion. - # ------------------------- Other : ------------------------------------- - # The calculus is based with vectors normalice - """ - - ori3=self.ProductVectorial(ori1,ori2) - refC=self.ProductVectorial(refA,refB) - res=math.pow(refC[0]-ori3[0],2) + math.pow(refC[1]-ori3[1],2) + math.pow(refC[2]-ori3[2],2) - return math.sqrt(res) - - def ProductVectorial(self,vec1,vec2): - """ - # ------------------------- Purpose : ----------------------------------- - # - Calculus of the poduct vectorial between two vectors 3D - # ------------------------- Parameters : -------------------------------- - # - : - type : vector 3D (float) - # - : - type : vector 3D (float) - # ------------------------- Return : ------------------------------------ - # (vec) : - Vector 3D - # ------------------------- Other : ------------------------------------- - """ - vec3=[0,0,0] - vec3[0]=vec1[1]*vec2[2] - vec1[2]*vec2[1] - vec3[1]=-( vec1[0]*vec2[2] - vec1[2]*vec2[0]) - vec3[2]=vec1[0]*vec2[1] - vec1[1]*vec2[0] - return vec3 - - def GetValuesDict(image): - """ - Returns a dictionnary containing values associated with Field Names - dict["Dicom Field Name"]="Dicom field value" - """ - val=image.GetFirstEntry() - dic={} - while(val): - if isinstance(val,gdcm.DataEntryPtr): - dic[val.GetName()]=val.GetValue() - val=image.GetNextEntry() - return dic - -*/ - - // ------------------------------------------------------------------------ /* 2.2.2 Orientation of DICOM images @@ -485,7 +345,12 @@ Some more stuff, from XMedcon ---> Personal remark from JPRx : --> patient_position (0x0018,0x5100) can be "HFS ", "FFS ", "HFP ", "FFP " ---> the cosines may ahave any value -1< <+1, for MR images ! +--> or, not so common, +// HFDR = Head First-Decubitus Right +// HFDL = Head First-Decubitus Left +// FFDR = Feet First-Decubitus Right +// FFDL = Feet First-Decubitus Left +--> the cosines may have any value -1.< <+1., for MR images ! enum patient_slice_orientation_type { diff --git a/src/gdcmSerieHelper.cxx b/src/gdcmSerieHelper.cxx index 47b2b57c..0228d427 100644 --- a/src/gdcmSerieHelper.cxx +++ b/src/gdcmSerieHelper.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSerieHelper.cxx,v $ Language: C++ - Date: $Date: 2005/10/21 08:49:36 $ - Version: $Revision: 1.26 $ + Date: $Date: 2005/10/21 16:02:01 $ + Version: $Revision: 1.27 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -228,7 +228,7 @@ void SerieHelper::AddRestriction(uint16_t group, uint16_t elem, } #ifndef GDCM_LEGACY_REMOVE -/** +/* * * \brief add a rules for restricting a DICOM file to be in the serie we are * trying to find. For example you can select only the DICOM file from a * directory which would have a particular EchoTime==4.0. @@ -328,9 +328,9 @@ bool SerieHelper::IsCoherent(FileList *fileSet) #ifndef GDCM_LEGACY_REMOVE /* * - * \brief accessor (DEPRECATED : use GetFirstSingleSerieUIDFileSet ) + * \ brief accessor (DEPRECATED : use GetFirstSingleSerieUIDFileSet ) * Warning : 'coherent' means here they have the same Serie UID - * @return The first FileList if found, otherwhise NULL + * @ return The first FileList if found, otherwhise NULL */ FileList *SerieHelper::GetFirstCoherentFileList() { @@ -341,10 +341,10 @@ FileList *SerieHelper::GetFirstCoherentFileList() } /* * - * \brief accessor (DEPRECATED : use GetNextSingleSerieUIDFileSet ) + * \ brief accessor (DEPRECATED : use GetNextSingleSerieUIDFileSet ) * Warning : 'coherent' means here they have the same Serie UID - * \note : meaningfull only if GetFirstCoherentFileList() already called - * @return The next FileList if found, otherwhise NULL + * \ note : meaningfull only if GetFirstCoherentFileList() already called + * @ return The next FileList if found, otherwhise NULL */ FileList *SerieHelper::GetNextCoherentFileList() { @@ -357,10 +357,10 @@ FileList *SerieHelper::GetNextCoherentFileList() } /* * - * \brief accessor (DEPRECATED : use GetSingleSerieUIDFileSet ) + * \ brief accessor (DEPRECATED : use GetSingleSerieUIDFileSet ) * Warning : 'coherent' means here they have the same Serie UID - * @param SerieUID SerieUID - * \return pointer to the FileList if found, otherwhise NULL + * @ param SerieUID SerieUID + * \ return pointer to the FileList if found, otherwhise NULL */ FileList *SerieHelper::GetCoherentFileList(std::string SerieUID) {