]> Creatis software - gdcm.git/commitdiff
Add some comments about pixel spacing
authorjpr <jpr>
Thu, 8 Jun 2006 13:37:33 +0000 (13:37 +0000)
committerjpr <jpr>
Thu, 8 Jun 2006 13:37:33 +0000 (13:37 +0000)
src/gdcmFile.cxx
src/gdcmTS.cxx
src/gdcmTS.h

index accb2b3f6040fe65ba67ec69965b28978eae3e24..9c55ec89dbe7b06e16f140041949b297a6d1e656 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2006/05/31 16:11:51 $
-  Version:   $Revision: 1.320 $
+  Date:      $Date: 2006/06/08 13:37:33 $
+  Version:   $Revision: 1.321 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -508,6 +508,36 @@ float File::GetXSpacing()
 {
    float xspacing = 1.0;
    uint32_t nbValue;
+/*   
+It *SHOULD* first find the IOD and then deduce which tags to read
+Eg: Cross section this is in Pixel Spacing (0028,0030)
+CR is in Imager Pixel Spacing (0018,1164)
+US is in Pixel Ratio (0028,0034)
+RT is in :
+(3002,0011) Image Plane Pixel Spacing
+(3002,0012) RT Image Position
+and
+(3004,000c) for deducing Z spacing 
+*/
+
+
+//   std::string SOPClassUID = GetEntryString(0x0008,0x0016);
+
+   /// \todo check the various SOP Class
+   ///       to get the Pixel Spacing at the proper location
+   
+       
+   // Ultrasound Image Storage (Retired)
+/* 
+   if (Util::DicomStringEqual( SOPClassUID,"1.2.840.10008.5.1.4.1.1.6")
+   {
+       - check if  SOPClassUID contains 2 parts (e.g. "4\3")
+       - guess how to deduce the spacing (FOV ?, ??)       
+   }
+   else
+   // go on with old method ...
+*/  
 
    // To follow David Clunie's advice, we first check ImagerPixelSpacing
 
index bc2b6c2f581a11586529e463ed6db2a0f38fc2b2..d10f663050493fd99addaa20b9b6208a7f0f68c3 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmTS.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/12/09 12:23:39 $
-  Version:   $Revision: 1.53 $
+  Date:      $Date: 2006/06/08 13:37:33 $
+  Version:   $Revision: 1.54 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -78,6 +78,11 @@ static const char *SpecialStrings[] =  {
   "1.2.840.10008.1.2.5",
   // MPEG2 Main Profile @ Main Level
   "1.2.840.10008.1.2.4.100",
+  
+  // The following are *not* t.s. but SOP uid
+  // Ultrasound Image Storage (Retired)
+  "1.2.840.10008.5.1.4.1.1.6",
+     
   // Unknown
   "Unknown Transfer Syntax", // Pretty sure we never use this case...
   NULL // Compilers have no obligation to finish by NULL, do it ourself
@@ -92,6 +97,7 @@ void FillDefaultTSDict(TSHT &ts);
 // Constructor / Destructor
 TS::TS() 
 {
+
    std::string filename = DictSet::BuildDictPath() + DICT_TS;
    std::ifstream from(filename.c_str());
    if ( !from )
@@ -115,6 +121,7 @@ TS::TS()
             TsMap[key] = name;
          }
       }
+
       from.close();
    }
 }
@@ -311,6 +318,24 @@ bool TS::IsMPEG(TSKey const &key)
    return r;
 }
 
+/**
+ * \brief   Determines if the SOP id corresponds to any form
+ *          of UltrasoundImageStorage_Retired.
+ * @return  True when Ultrasound Image Storage Retired. False otherwise.
+ */
+bool TS::IsUltrasoundImageStorage_Retired(TSKey const &key)
+{
+   bool r = false;
+   // First check this is an actual SOP id
+   if ( IsTransferSyntax(key) )
+   {
+      if ( key == SpecialStrings[UltrasoundImageStorage_Retired] ) 
+      {
+         r = true;
+      }
+   }
+   return r;
+}
 /**
  * \brief   GetSpecialTransferSyntax ??
  * @param  key TSKey const &key ??
@@ -333,7 +358,7 @@ TS::SpecialType TS::GetSpecialTransferSyntax(TSKey const &key)
  * @param  t SpecialType t ??
  * @return  char* TS : SpecialStrings[t] ??.
  */
-const charTS::GetSpecialTransferSyntax(SpecialType t)
+const char *TS::GetSpecialTransferSyntax(SpecialType t)
 {
    return SpecialStrings[t];
 }
index e5398dd91ef0982a68800d5d4e4e1ab9d354b0e2..773a8ff6514e08fe291246fcd1c034982bc6c172 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmTS.h,v $
   Language:  C++
-  Date:      $Date: 2005/11/29 17:11:52 $
-  Version:   $Revision: 1.27 $
+  Date:      $Date: 2006/06/08 13:37:33 $
+  Version:   $Revision: 1.28 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -61,7 +61,11 @@ public:
    JPEG2000Lossless,  
    JPEG2000,
    RLELossless,
-   MPEG2MainProfile,  
+   MPEG2MainProfile,
+   
+// The following are *not* Transfer Syntaxes, but SOP uid   
+   UltrasoundImageStorage_Retired,
+   
    UnknownTS
    };
 
@@ -82,11 +86,14 @@ public:
    bool IsJPEG(TSKey const &key);
    bool IsJPEGLS(TSKey const &key);
    bool IsMPEG(TSKey const &key);
-
+   
    // This should be deprecated very soon
    SpecialType GetSpecialTransferSyntax(TSKey const &key);
    const char* GetSpecialTransferSyntax(SpecialType t);
-
+   
+   // The following are *not* Transfer Syntaxes.      
+   bool IsUltrasoundImageStorage_Retired(TSKey const &key);
+  
 protected:
    TS();
    ~TS();