Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asking question about registration! #225

Open
happywind-boy opened this issue Jun 1, 2023 · 0 comments
Open

Asking question about registration! #225

happywind-boy opened this issue Jun 1, 2023 · 0 comments

Comments

@happywind-boy
Copy link

happywind-boy commented Jun 1, 2023

I met the problem :

RuntimeError: D:\a\im_skbuild\win-amd64-3.7\cmake-build_deps\elx-src\Core\Main\itkElastixRegistrationMethod.hxx:259:
ITK ERROR: ElastixRegistrationMethod(0000016D583B26B0): Internal elastix error: See elastix log (use LogToConsoleOn() or LogToFileOn()).

Please tell me the reason for the above problem.
Thanks!

And my code is as follows :

  import itk

  def registration(Fixed_image, Moving_image, Label_image, LabelOutput):
 
        fixed_image = itk.imread(Fixed_image, itk.F)
        moving_image = itk.imread(Moving_image, itk.F)
  
        parameter_object = itk.ParameterObject.New()
        parameter_map_rigid = parameter_object.GetDefaultParameterMap('rigid')
        parameter_object.AddParameterMap(parameter_map_rigid)
        result_registered_image, result_transform_parameters = itk.elastix_registration_method(
            fixed_image, moving_image, parameter_object=parameter_object)
        if Label_image:
            result_transform_parameters.SetParameter('FinalBSplineInterpolationOrder', '0')
            label_image = itk.imread(Label_image, itk.F)
            transform_label_image = itk.transformix_filter(label_image, result_transform_parameters)
            itk.imwrite(transform_label_image, LabelOutput)
        return result_registered_image


  temp_img_path = os.path.join(r'D:\python_01\AutoSegmentation\temp', 'temp.nii.gz')
  temp_brain_path = os.path.join(r'D:\python_01\AutoSegmentation\temp', 'temp_brain.nii.gz')
  temp_save = os.path.join(r'D:\python_01\AutoSegmentation\Image', 'HF0990_btemp_brain.nii.gz')
  Regis = registration(os.path.join(r'D:\python_01\AutoSegmentation\Image', f'HF0990_T2_resample.nii.gz'),
                 temp_img_path, Label_image=temp_brain_path, LabelOutput=temp_save)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant