+ DataEntry *entry;
+ bool ok = false;
+/*
+From:David Clunie - view profile
+Date:Wed, May 24 2006 1:12 pm
+Email:David Clunie <dclu...@dclunie.com>
+Groups:comp.protocols.dicom
+
+The short answer is that:
+
+- (0018,1164) describes a spacing equivalent to that which
+ would be measured off a film in projection radiography
+
+- (0018,7022) does not describe the image pixels themselves,
+ since detector elements may have been binned to produce
+ pixels
+
+- (0018,7020) may be different from (0018,7022) since there
+ may be non-sensitive material separating individual
+ detectors (i.e. the size is smaller than the spacing
+ between centers)
+
+Only (0018,1164) is relevant when measuring things; the
+detector-specific attributes are there to describe the
+acquisition.
+
+David
+
+PS. For ultrasound you need to use Region Calibration.
+*/
+
+/*
+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 Aspect 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
+
+ ///\todo find images to check if it *actually* works
+
+ if (Util::DicomStringEqual( SOPClassUID,"1.2.840.10008.5.1.4.1.1.6")
+ // Ultrasound Image Storage (Retired)
+ || Util::DicomStringEqual( SOPClassUID,"1.2.840.10008.5.1.4.1.1.6.1")
+ // Ultrasound Image Storage
+ || Util::DicomStringEqual( SOPClassUID,"1.2.840.10008.5.1.4.1.1.3")
+ // Ultrasound Multi-Frame Storage (Retired)
+ || Util::DicomStringEqual( SOPClassUID,"1.2.840.10008.5.1.4.1.1.3.1") )
+ // Ultrasound Multi-FrameImage Storage
+ {
+ // - check if SOPClassUID contains 2 parts (e.g. "4\3")
+ // - guess how to deduce the spacing (FOV ?, ??)
+
+ entry = GetDataEntry(0x0028,0x0034);
+ if ( entry )
+ {
+ nbValue = entry->GetValueCount();
+ if( nbValue !=2 ) {
+ gdcmWarningMacro("PixelAspectRatio (0x0028,0x0034) "
+ << "has a wrong number of values :" << nbValue);
+ }
+ xspacing = 1.0; // We get Pixel Aspect Ratio, not Spacing ...
+ ok = true;
+ }
+
+ if (ok)
+ return xspacing;
+ }
+/*
+ if (Util::DicomStringEqual( SOPClassUID,"1.2.840.10008.5.1.4.1.1.1") )
+ // Computed Radiography Image Storage
+
+ // CR is in Imager Pixel Spacing (0018,1164)//