ANTsX / ANTsRCore

Rcpp bindings for the C++ ANTs library used by the ANTsR package
9 stars 9 forks source link

FIX: use modified image info correctly #77

Closed jeffduda closed 5 years ago

jeffduda commented 5 years ago

Resolve issue where images are written using the meta info from the original file, instead of using info that changed via antsSet*() methods.

A resolution to issue #75

stnava commented 5 years ago

Need to think about this disconnect pipeline issue and better understand .... i would think that local filters going out of scope would resolve but i guess this depends on gc behavior. can you think of a way to test this?

jeffduda commented 5 years ago

One problem is that they don't necessarily go out of scope. For example, if after reading in an image you do img->GetSource() you can see that it has retained the pointer to the FileReader that read the image. In the case of a larger pipeline, assuming they all keep the pointer to their source, you can see how this would add up. DisconnectPipeline() just sets that source pointer to null to that they then should just resolve. I'll start a branch to examine this further, starting with just creating some large pipelines to see if any memory issues are easily detectable.