Closed cookpa closed 3 months ago
Additional ANTs fixes ready for update here https://github.com/ANTsX/ANTs/issues/1702
Going through the C++ code replacing Allocate with AllocateInitialized - just wanted to note this
a prior call to FillBuffer is commented out for some reason. Hopefully just a performance thing
Im guessing I just missed that one.
@ntustison this is in the ANTsPy code, I think you got everything in ANTsX/ANTs
I'm trying to figure out if images with Vector pixel type require special handling. Elsewhere we have
VectorType zeroVector( 0.0 );
ITKFieldPointerType rasterizedField = ITKFieldType::New();
rasterizedField->SetOrigin( bsplineFilter->GetBSplineDomainOrigin() );
rasterizedField->SetSpacing( bsplineFilter->GetBSplineDomainSpacing() );
rasterizedField->SetDirection( bsplineFilter->GetBSplineDomainDirection() );
rasterizedField->SetRegions( bsplineFilter->GetBSplineDomainSize() );
rasterizedField->Allocate();
rasterizedField->FillBuffer( zeroVector );
I am hoping we can just call rasterizedField->AllocateInitialized
. I think this is the case because itkImage must be aware of the total buffer size it needs to initialize
Okay, was on my phone. There's quite a few code blocks like this where we're switching back and forth from an image of vectors to a vector image. I would assume there's nothing complicated going on and whatever changes you want to make should be fine.
Relating to #579. Further fixes may be pending on the ANTs side (https://github.com/ANTsX/ANTs/issues/1701)