@@ -48,6 +48,7 @@ namespace gdcm
48
48
bool ImageHelper::ForceRescaleInterceptSlope = false ;
49
49
bool ImageHelper::PMSRescaleInterceptSlope = true ;
50
50
bool ImageHelper::ForcePixelSpacing = false ;
51
+ bool ImageHelper::SecondaryCaptureImagePlaneModule = false ;
51
52
52
53
static bool GetOriginValueFromSequence (const DataSet& ds, const Tag& tfgs, std::vector<double > &ori)
53
54
{
@@ -578,7 +579,7 @@ std::vector<double> ImageHelper::GetOriginValue(File const & f)
578
579
579
580
// else
580
581
const Tag timagepositionpatient (0x0020 , 0x0032 );
581
- if ( ds.FindDataElement ( timagepositionpatient ) )
582
+ if ( (ms != MediaStorage::SecondaryCaptureImageStorage || SecondaryCaptureImagePlaneModule) && ds.FindDataElement ( timagepositionpatient ) )
582
583
{
583
584
const DataElement& de = ds.GetDataElement ( timagepositionpatient );
584
585
Attribute<0x0020 ,0x0032 > at = {{0 ,0 ,0 }}; // default value if empty
@@ -730,7 +731,7 @@ std::vector<double> ImageHelper::GetDirectionCosinesValue(File const & f)
730
731
}
731
732
732
733
dircos.resize ( 6 );
733
- if ( !GetDirectionCosinesFromDataSet (ds, dircos) )
734
+ if ( (ms == MediaStorage::SecondaryCaptureImageStorage && !SecondaryCaptureImagePlaneModule) || !GetDirectionCosinesFromDataSet (ds, dircos) )
734
735
{
735
736
dircos[0 ] = 1 ;
736
737
dircos[1 ] = 0 ;
@@ -774,6 +775,16 @@ bool ImageHelper::GetForcePixelSpacing()
774
775
return ForcePixelSpacing;
775
776
}
776
777
778
+ void ImageHelper::SetSecondaryCaptureImagePlaneModule (bool b)
779
+ {
780
+ SecondaryCaptureImagePlaneModule = b;
781
+ }
782
+
783
+ bool ImageHelper::GetSecondaryCaptureImagePlaneModule ()
784
+ {
785
+ return SecondaryCaptureImagePlaneModule;
786
+ }
787
+
777
788
bool GetRescaleInterceptSlopeValueFromDataSet (const DataSet& ds, std::vector<double > & interceptslope)
778
789
{
779
790
Attribute<0x0028 ,0x1052 > at1;
0 commit comments