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

Transformix not returning transformation field #20

Open
w013nad opened this issue Jun 14, 2017 · 3 comments
Open

Transformix not returning transformation field #20

w013nad opened this issue Jun 14, 2017 · 3 comments
Labels
dead issue no activity for ages

Comments

@w013nad
Copy link

w013nad commented Jun 14, 2017

In transformix, it's supposed to be possible to output a deformation field rather than an image. (I'm working with hyperspectral so it's much easier to get the deformation field and transform all the layers individually using the deformation field. Anyway, I came up with a fix outlined below. Note that the fix is tailored to my needs. This is for a 2D image, not sure how it would work for 3D
Originally I did get an output but it was an empty 1x1 stucture

fid = fopen(fullfile(outputDir,'deformationField.raw'));
raw_out = fread(fid,Inf,'float');
out_points(:,:,1) = reshape(raw_out(1:2:end),size_im(2),size_im(1));
out_points(;,:,2) = reshape(raw_out(2:2:end),size_im(2),size_im(1));
out_points = permute(out_points,[2,1,3]);

From there, I'm able to just cycle through and call
for ii = 1:num_channels
out(:,:,ii) = imwarp(moving(:,:,ii),out_points);
end

I originally just ran all the layers through but this comes out to a 1.5 minutes saving per data cube processed.

Also, how to I insert code formatting here? Not used to github.

@raacampbell
Copy link
Owner

Thanks, I'll look into this.

@w013nad
Copy link
Author

w013nad commented Jun 14, 2017

Short update. When I did this, my error rates jumped way up. It's still deforming correctly but my RMSE of desired output to actual output jumped form 0.03 to 0.04. Not really sure why.

@raacampbell raacampbell added the dead issue no activity for ages label May 4, 2021
@raacampbell
Copy link
Owner

Not followed up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dead issue no activity for ages
Projects
None yet
Development

No branches or pull requests

2 participants