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

motioncorr() with image stacks, rather than filepaths? #5

Open
IanButterworth opened this issue Mar 4, 2019 · 2 comments
Open

motioncorr() with image stacks, rather than filepaths? #5

IanButterworth opened this issue Mar 4, 2019 · 2 comments

Comments

@IanButterworth
Copy link
Contributor

IanButterworth commented Mar 4, 2019

Is there an easy modification to motioncorr() to allow registration of image stacks (i.e. Vector{Array{UInt8}}) ?

@IanButterworth
Copy link
Contributor Author

IanButterworth commented Mar 4, 2019

By the way, my main reason for the suppressout addition in #4 was to help ProgressMeter display when register()-ing through an image stack in memory manually, otherwise the amount of text output per frame is huge

@timholy
Copy link
Owner

timholy commented Mar 21, 2019

to allow registration of image stacks

It already registers stacks, but requires a file rather than an array. (I presume that's what you meant, but just in case.) At least with this approach I think the only option would be to write that stack to a file like in

function register(output, fixed::AbstractArray, moving::AbstractArray, pipeline::AbstractVector{<:Stage}; kwargs...)
maskfile = ""
if any(isnan, fixed)
# Create a mask
error("not sure how a mask file should be implemented")
end
fixedname = write_nrrd(fixed)
movingname = write_nrrd(moving)
imgw = register(output, sdims(fixed), fixedname, movingname, pipeline; kwargs...)
rm(movingname)
rm(fixedname)
end
.

Alternatively, one could see if ANTs offers a ccallable API; that might allow one to bypass all the file stuff. Given it uses ITK it may all be C++, so you'd need Cxx or CxxWrap.

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

2 participants