@@ -186,16 +186,16 @@ def test_use_reference_space(ref_filepath, filepath):
186186 image .SetSpacing ([1.2 , 2.0 , 1.7 ][:ndim ])
187187 ref_image .SetSpacing ([1.9 , 1.5 , 1.3 ][:ndim ])
188188
189- direction = np .eye ( 3 , dtype = np . float64 )
190- direction [ 0 , 0 ] = 0.68
191- direction [ 1 , 1 ] = 1.05
192- direction [ 2 , 2 ] = 1.83
189+ direction = np .array ([[ 1.02895588 , 0.22791448 , 0.02429561 ],
190+ [ 0.21927512 , 1.28632268 , - 0.14932226 ],
191+ [ 0.47455613 , 0.38534345 , 0.98505633 ]],
192+ dtype = np . float64 )
193193 image .SetDirection (direction [:ndim , :ndim ])
194194
195- ref_direction = np .eye ( 3 , dtype = np . float64 )
196- ref_direction [ 0 , 0 ] = 1.25
197- ref_direction [ 1 , 1 ] = 0.99
198- ref_direction [ 2 , 2 ] = 1.50
195+ ref_direction = np .array ([[ 1.26032417 , - 0.19243174 , 0.54877414 ],
196+ [ 0.31958275 , 0.9543068 , 0.2720827 ],
197+ [ - 0.24106769 , - 0.22344502 , 0.9143302 ]],
198+ dtype = np . float64 )
199199 ref_image .SetDirection (ref_direction [:ndim , :ndim ])
200200
201201 image .SetOrigin ([57.3 , 102.0 , - 20.9 ][:ndim ])
@@ -224,8 +224,4 @@ def test_use_reference_space(ref_filepath, filepath):
224224 print ("[Min, Max] ITK: [{}, {}]" .format (output_array_itk .min (), output_array_itk .max ()))
225225 print ("[Min, Max] diff: [{}, {}]" .format (diff_output .min (), diff_output .max ()))
226226
227- itk .imwrite (itk .GetImageFromArray (diff_output ), "./output/diff.tif" )
228- itk .imwrite (itk .GetImageFromArray (output_array_monai ), "./output/output_monai.tif" )
229- itk .imwrite (itk .GetImageFromArray (output_array_itk ), "./output/output_itk.tif" )
230-
231227
0 commit comments