InsightSoftwareConsortium / ITKElastix

An ITK Python interface to elastix, a toolbox for rigid and nonrigid registration of images
Apache License 2.0
190 stars 23 forks source link

GroupwiseRegistration notebook: ERROR: the direction cosines matrix of the fixed image is invalid! #291

Open thewtex opened 1 month ago

thewtex commented 1 month ago

Error:

itk::ExceptionObject (0x562ce335dd80)
130
Location: "unknown" 
131
File: /work/build/cp38-cp38-manylinux_2_28_x86_64/_deps/elx-src/Components/Metrics/VarianceOverLastDimension/elxVarianceOverLastDimensionMetric.hxx
132
Line: 71
133
Description: ITK ERROR: VarianceOverLastDimensionMetric(0x562cdaf45be0): 
134
ERROR: the direction cosines matrix of the fixed image is invalid!
135

136
  The VarianceOverLastDimensionMetric expects the last dimension to represent
137
  time and therefore requires a direction cosines matrix of the form:
138
       [ . . 0 ]
139
  dc = [ . . 0 ]
140
       [ 0 0 1 ]

@N-Dekker any ideas?

N-Dekker commented 1 month ago

@thewtex Thanks for asking! This check was added by commit https://github.com/SuperElastix/elastix/commit/e9a02d9938c17f2705d874ac6ce9235cb3368db8 (Aug 6, 2014). Can you possibly still print the direction matrix of the fixed image, to get more details? I mean: this->GetElastix()->GetFixedImage()->GetDirection() at https://github.com/SuperElastix/elastix/blob/ef03c8d1795ed78e889e273fc8d3b93c6da53683/Components/Metrics/VarianceOverLastDimension/elxVarianceOverLastDimensionMetric.hxx#L59

thewtex commented 2 weeks ago

@N-Dekker thanks for taking a look! :pray:

The direction is:

1 0 0
0 1 0
0 0 -1

(note the -1).