Giter Site home page Giter Site logo

Comments (7)

ntustison avatar ntustison commented on June 21, 2024

How did you produce the deformation field?

from ants.

domadaaaa avatar domadaaaa commented on June 21, 2024

How did you produce the deformation field?

That's exactly what I want to know too LOL

from ants.

cookpa avatar cookpa commented on June 21, 2024

Are you asking how to do image registration? Start with the script antsRegistrationSyNQuick.sh

from ants.

domadaaaa avatar domadaaaa commented on June 21, 2024

Are you asking how to do image registration? Start with the script antsRegistrationSyNQuick.sh
No... I would like to obtain a deformation field file generated during the registration process

from ants.

cookpa avatar cookpa commented on June 21, 2024

I'm a little confused, running the registration script with its default parameters will produce a deformation field in NIFTI format.

from ants.

domadaaaa avatar domadaaaa commented on June 21, 2024

I'm a little confused, running the registration script with its default parameters will produce a deformation field in NIFTI format.

sry,there is something wrong with my expression. I registrat with python package antspy running in linux
my code is as follows, can i modify code to obtain the deformation field?
`
import ants
from scipy.ndimage import zoom
import nibabel as nib
import numpy as np

fixed = ants.image_read("MRI.nii.gz")

img = nib.load('CT.nii.gz')
moving = img.get_fdata()

scale = (0.9375, 0.9375, 0.6)
moving = zoom(moving, scale)

moving = nib.Nifti1Image(moving, img.affine, img.header)
nib.save(moving, 're_CT.nii.gz')

moving = ants.image_read("re_CT.nii.gz")

SyN = ants.registration(fixed=fixed, moving=moving, save_state=True)
result = ants.apply_transforms(fixed=fixed, moving=moving, transformlist=SyN['fwdtransforms'])

ants.image_write(result, 'moved.nii.gz')
`

from ants.

cookpa avatar cookpa commented on June 21, 2024

Ok I think I understand now

SyN['fwdtransforms']

This should be a list of strings, they are file names. The first one will be the deformation field, in NIFTI format.

They can be read with the read_transform function

from ants.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.