diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b852ea18..acba0afe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -330,7 +330,7 @@ py::capsule antsImageClone( py::capsule antsImage ) out_image->SetOrigin( in_image->GetOrigin() ) ; out_image->SetDirection( in_image->GetDirection() ); //out_image->CopyInformation( in_image ); - out_image->Allocate() ; + out_image->AllocateInitialized() ; itk::ImageRegionConstIterator< InImageType > in_iterator( in_image , in_image->GetLargestPossibleRegion() ) ; itk::ImageRegionIterator< OutImageType > out_iterator( out_image , out_image->GetLargestPossibleRegion() ) ; diff --git a/ants/lib/ANTsVersionConfig.h b/ants/lib/ANTsVersionConfig.h index 3b9f0dd1..af4aae41 100644 --- a/ants/lib/ANTsVersionConfig.h +++ b/ants/lib/ANTsVersionConfig.h @@ -17,7 +17,7 @@ *=========================================================================*/ #define ANTS_VERSION_MAJOR 2 -#define ANTS_VERSION_MINOR 3 -#define ANTS_VERSION_PATCH 5 +#define ANTS_VERSION_MINOR 5 +#define ANTS_VERSION_PATCH 1 #define ANTS_VERSION_TWEAK -#define ANTS_VERSION "v2.3.5.post95-g6f07ac5" +#define ANTS_VERSION "v2.5.1.post95-g2236a75" diff --git a/ants/lib/LOCAL_antsImageClone.cxx b/ants/lib/LOCAL_antsImageClone.cxx index d096b29d..307a1788 100644 --- a/ants/lib/LOCAL_antsImageClone.cxx +++ b/ants/lib/LOCAL_antsImageClone.cxx @@ -25,7 +25,7 @@ py::capsule antsImageClone( py::capsule antsImage ) out_image->SetOrigin( in_image->GetOrigin() ) ; out_image->SetDirection( in_image->GetDirection() ); //out_image->CopyInformation( in_image ); - out_image->Allocate() ; + out_image->AllocateInitialized(); itk::ImageRegionConstIterator< InImageType > in_iterator( in_image , in_image->GetLargestPossibleRegion() ) ; itk::ImageRegionIterator< OutImageType > out_iterator( out_image , out_image->GetLargestPossibleRegion() ) ; diff --git a/ants/lib/LOCAL_antsImageToImageMetric.h b/ants/lib/LOCAL_antsImageToImageMetric.h index c500537f..a42a5910 100644 --- a/ants/lib/LOCAL_antsImageToImageMetric.h +++ b/ants/lib/LOCAL_antsImageToImageMetric.h @@ -359,8 +359,7 @@ ANTsImageToImageMetric< MetricBaseType > create_ants_metric(std::string pixeltyp itkField->SetSpacing( moving->GetSpacing() ); itkField->SetOrigin( moving->GetOrigin() ); itkField->SetDirection( moving->GetDirection() ); - itkField->Allocate(); - //itkField->FillBuffer(0); + itkField->AllocateInitialized(); typename TransformType::Pointer idTransform = TransformType::New(); idTransform->SetDisplacementField( itkField ); diff --git a/ants/lib/LOCAL_antsTransform.cxx b/ants/lib/LOCAL_antsTransform.cxx index ef9730c1..b9021610 100644 --- a/ants/lib/LOCAL_antsTransform.cxx +++ b/ants/lib/LOCAL_antsTransform.cxx @@ -84,7 +84,7 @@ py::capsule antsTransformFromDisplacementField( py::capsule field ) itkField->SetSpacing( antsrField->GetSpacing() ); itkField->SetOrigin( antsrField->GetOrigin() ); itkField->SetDirection( antsrField->GetDirection() ); - itkField->Allocate(); + itkField->AllocateInitialized(); typedef itk::ImageRegionIteratorWithIndex IteratorType; IteratorType it( itkField, itkField->GetLargestPossibleRegion() ); @@ -143,7 +143,7 @@ py::capsule antsTransformToDisplacementField( py::capsule xfrm, py::capsule ref antsrField->CopyInformation( domainImage ); antsrField->SetRegions( domainImage->GetLargestPossibleRegion() ); antsrField->SetNumberOfComponentsPerPixel( Dimension ); - antsrField->Allocate(); + antsrField->AllocateInitialized(); typedef itk::ImageRegionIteratorWithIndex IteratorType; IteratorType it( domainImage, domainImage->GetLargestPossibleRegion() ); @@ -213,7 +213,7 @@ PYBIND11_MODULE(antsTransform, m) { m.def("transformImageD2UC4", &transformImage, itk::Image>); m.def("transformImageD3UC4", &transformImage, itk::Image>); m.def("transformImageD4UC4", &transformImage, itk::Image>); - + m.def("transformImageF2UI2", &transformImage, itk::Image>); m.def("transformImageF3UI3", &transformImage, itk::Image>); m.def("transformImageF4UI4", &transformImage, itk::Image>); diff --git a/ants/lib/LOCAL_composeDisplacementFields.cxx b/ants/lib/LOCAL_composeDisplacementFields.cxx index 4483bce8..fda4a3ec 100644 --- a/ants/lib/LOCAL_composeDisplacementFields.cxx +++ b/ants/lib/LOCAL_composeDisplacementFields.cxx @@ -57,14 +57,14 @@ py::capsule composeDisplacementFields( py::capsule & antsDisplacementField, inputITKDisplacementField->SetRegions( fieldSize ); inputITKDisplacementField->SetSpacing( fieldSpacing ); inputITKDisplacementField->SetDirection( fieldDirection ); - inputITKDisplacementField->Allocate(); + inputITKDisplacementField->AllocateInitialized(); ITKFieldPointerType inputITKWarpingField = ITKFieldType::New(); inputITKWarpingField->SetOrigin( fieldOrigin ); inputITKWarpingField->SetRegions( fieldSize ); inputITKWarpingField->SetSpacing( fieldSpacing ); inputITKWarpingField->SetDirection( fieldDirection ); - inputITKWarpingField->Allocate(); + inputITKWarpingField->AllocateInitialized(); IteratorType ItF( inputITKDisplacementField, inputITKDisplacementField->GetRequestedRegion() ); IteratorType ItE( inputITKWarpingField, inputITKWarpingField->GetRequestedRegion() ); @@ -100,7 +100,7 @@ py::capsule composeDisplacementFields( py::capsule & antsDisplacementField, antsField->CopyInformation( composer->GetOutput() ); antsField->SetRegions( composer->GetOutput()->GetRequestedRegion() ); antsField->SetVectorLength( Dimension ); - antsField->Allocate(); + antsField->AllocateInitialized(); ConstIteratorType ItI( composer->GetOutput(), composer->GetOutput()->GetRequestedRegion() ); diff --git a/ants/lib/LOCAL_fitBsplineDisplacementField.cxx b/ants/lib/LOCAL_fitBsplineDisplacementField.cxx index d086b6a0..1f92210b 100644 --- a/ants/lib/LOCAL_fitBsplineDisplacementField.cxx +++ b/ants/lib/LOCAL_fitBsplineDisplacementField.cxx @@ -77,7 +77,7 @@ py::capsule fitBsplineVectorImageHelper( inputITKField->SetRegions( fieldSize ); inputITKField->SetSpacing( fieldSpacing ); inputITKField->SetDirection( fieldDirection ); - inputITKField->Allocate(); + inputITKField->AllocateInitialized(); IteratorType It( inputITKField, inputITKField->GetRequestedRegion() ); for( It.GoToBegin(); !It.IsAtEnd(); ++It ) @@ -190,7 +190,7 @@ py::capsule fitBsplineVectorImageHelper( antsField->CopyInformation( bsplineFilter->GetOutput() ); antsField->SetRegions( bsplineFilter->GetOutput()->GetRequestedRegion() ); antsField->SetVectorLength( Dimension ); - antsField->Allocate(); + antsField->AllocateInitialized(); IteratorType ItB( bsplineFilter->GetOutput(), bsplineFilter->GetOutput()->GetRequestedRegion() ); diff --git a/ants/lib/LOCAL_fitBsplineDisplacementFieldToScatteredData.cxx b/ants/lib/LOCAL_fitBsplineDisplacementFieldToScatteredData.cxx index 95dc19e2..29dd1b23 100644 --- a/ants/lib/LOCAL_fitBsplineDisplacementFieldToScatteredData.cxx +++ b/ants/lib/LOCAL_fitBsplineDisplacementFieldToScatteredData.cxx @@ -107,25 +107,21 @@ py::capsule fitBsplineVectorImageToScatteredDataHelper( weightImage->SetSpacing( bsplineFilter->GetBSplineDomainSpacing() ); weightImage->SetDirection( bsplineFilter->GetBSplineDomainDirection() ); weightImage->SetRegions( bsplineFilter->GetBSplineDomainSize() ); - weightImage->Allocate(); - weightImage->FillBuffer( 0.0 ); + weightImage->AllocateInitialized(); WeightImagePointerType countImage = WeightImageType::New(); countImage->SetOrigin( bsplineFilter->GetBSplineDomainOrigin() ); countImage->SetSpacing( bsplineFilter->GetBSplineDomainSpacing() ); countImage->SetDirection( bsplineFilter->GetBSplineDomainDirection() ); countImage->SetRegions( bsplineFilter->GetBSplineDomainSize() ); - countImage->Allocate(); - countImage->FillBuffer( 0.0 ); + countImage->AllocateInitialized(); - 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 ); + rasterizedField->AllocateInitialized(); for( unsigned int n = 0; n < numberOfPoints; n++ ) { @@ -214,7 +210,7 @@ py::capsule fitBsplineVectorImageToScatteredDataHelper( antsField->CopyInformation( bsplineFilter->GetOutput() ); antsField->SetRegions( bsplineFilter->GetOutput()->GetRequestedRegion() ); antsField->SetVectorLength( Dimension ); - antsField->Allocate(); + antsField->AllocateInitialized(); IteratorType It( bsplineFilter->GetOutput(), bsplineFilter->GetOutput()->GetRequestedRegion() ); diff --git a/ants/lib/LOCAL_fitBsplineObjectToScatteredData.cxx b/ants/lib/LOCAL_fitBsplineObjectToScatteredData.cxx index 067940d8..09da4dd5 100644 --- a/ants/lib/LOCAL_fitBsplineObjectToScatteredData.cxx +++ b/ants/lib/LOCAL_fitBsplineObjectToScatteredData.cxx @@ -313,7 +313,7 @@ py::capsule fitBsplineVectorImageHelper( antsField->SetSpacing( spacing ); antsField->SetVectorLength( DataDimension ); antsField->SetDirection( direction ); - antsField->Allocate(); + antsField->AllocateInitialized(); IteratorType It( bsplineFilter->GetOutput(), bsplineFilter->GetOutput()->GetRequestedRegion() ); diff --git a/ants/lib/LOCAL_fitThinPlateSplineDisplacementFieldToScatteredData.cxx b/ants/lib/LOCAL_fitThinPlateSplineDisplacementFieldToScatteredData.cxx index 6c4e3fd9..94ff15f0 100644 --- a/ants/lib/LOCAL_fitThinPlateSplineDisplacementFieldToScatteredData.cxx +++ b/ants/lib/LOCAL_fitThinPlateSplineDisplacementFieldToScatteredData.cxx @@ -80,7 +80,7 @@ py::capsule fitThinPlateSplineVectorImageToScatteredDataHelper( field->SetOrigin( fieldOrigin ); field->SetSpacing( fieldSpacing ); field->SetDirection( fieldDirection ); - field->Allocate(); + field->AllocateInitialized(); } auto sourceLandmarks = PointSetType::New(); @@ -119,7 +119,7 @@ py::capsule fitThinPlateSplineVectorImageToScatteredDataHelper( antsField->CopyInformation( field ); antsField->SetRegions( field->GetRequestedRegion() ); antsField->SetVectorLength( Dimension ); - antsField->Allocate(); + antsField->AllocateInitialized(); typename TransformType::InputPointType source; typename TransformType::OutputPointType target; diff --git a/ants/lib/LOCAL_integrateVelocityField.cxx b/ants/lib/LOCAL_integrateVelocityField.cxx index a968b293..53475b1e 100644 --- a/ants/lib/LOCAL_integrateVelocityField.cxx +++ b/ants/lib/LOCAL_integrateVelocityField.cxx @@ -45,7 +45,7 @@ py::capsule integrateVelocityField( py::capsule & antsVelocityField, ITKVelocityFieldPointerType inputITKVelocityField = ITKVelocityFieldType::New(); inputITKVelocityField->CopyInformation( inputVelocityField ); inputITKVelocityField->SetRegions( inputVelocityField->GetRequestedRegion() ); - inputITKVelocityField->Allocate(); + inputITKVelocityField->AllocateInitialized(); IteratorType It( inputITKVelocityField, inputITKVelocityField->GetRequestedRegion() ); @@ -79,7 +79,7 @@ py::capsule integrateVelocityField( py::capsule & antsVelocityField, antsField->CopyInformation( integrator->GetOutput() ); antsField->SetRegions( integrator->GetOutput()->GetRequestedRegion() ); antsField->SetVectorLength( Dimension ); - antsField->Allocate(); + antsField->AllocateInitialized(); ConstIteratorType ItI( integrator->GetOutput(), integrator->GetOutput()->GetRequestedRegion() ); diff --git a/ants/lib/LOCAL_invertDisplacementField.cxx b/ants/lib/LOCAL_invertDisplacementField.cxx index 24e64cf6..1cdfecc7 100644 --- a/ants/lib/LOCAL_invertDisplacementField.cxx +++ b/ants/lib/LOCAL_invertDisplacementField.cxx @@ -61,14 +61,14 @@ py::capsule invertDisplacementField( py::capsule & antsDisplacementField, inputITKDisplacementField->SetRegions( fieldSize ); inputITKDisplacementField->SetSpacing( fieldSpacing ); inputITKDisplacementField->SetDirection( fieldDirection ); - inputITKDisplacementField->Allocate(); + inputITKDisplacementField->AllocateInitialized(); ITKFieldPointerType inputITKInverseFieldInitialEstimate = ITKFieldType::New(); inputITKInverseFieldInitialEstimate->SetOrigin( fieldOrigin ); inputITKInverseFieldInitialEstimate->SetRegions( fieldSize ); inputITKInverseFieldInitialEstimate->SetSpacing( fieldSpacing ); inputITKInverseFieldInitialEstimate->SetDirection( fieldDirection ); - inputITKInverseFieldInitialEstimate->Allocate(); + inputITKInverseFieldInitialEstimate->AllocateInitialized(); IteratorType ItF( inputITKDisplacementField, inputITKDisplacementField->GetRequestedRegion() ); IteratorType ItE( inputITKInverseFieldInitialEstimate, inputITKInverseFieldInitialEstimate->GetRequestedRegion() ); @@ -108,7 +108,7 @@ py::capsule invertDisplacementField( py::capsule & antsDisplacementField, antsField->CopyInformation( inverter->GetOutput() ); antsField->SetRegions( inverter->GetOutput()->GetRequestedRegion() ); antsField->SetVectorLength( Dimension ); - antsField->Allocate(); + antsField->AllocateInitialized(); ConstIteratorType ItI( inverter->GetOutput(), inverter->GetOutput()->GetRequestedRegion() ); diff --git a/ants/lib/LOCAL_mergeChannels.cxx b/ants/lib/LOCAL_mergeChannels.cxx index cf855bd3..e19cdf79 100644 --- a/ants/lib/LOCAL_mergeChannels.cxx +++ b/ants/lib/LOCAL_mergeChannels.cxx @@ -34,7 +34,7 @@ py::capsule mergeChannels( std::vector imageList ) vectorImage->SetOrigin( images[0]->GetOrigin() ); vectorImage->SetDirection( images[0]->GetDirection() ); vectorImage->SetNumberOfComponentsPerPixel( nImages ); - vectorImage->Allocate(); + vectorImage->AllocateInitialized(); // Fill image data itk::ImageRegionIteratorWithIndex it( vectorImage, @@ -75,7 +75,7 @@ py::capsule mergeChannels2( std::vector imageList ) vectorImage->SetOrigin( images[0]->GetOrigin() ); vectorImage->SetDirection( images[0]->GetDirection() ); vectorImage->SetNumberOfComponentsPerPixel( nImages ); - vectorImage->Allocate(); + vectorImage->AllocateInitialized(); // Fill image data itk::ImageRegionIteratorWithIndex it( vectorImage, @@ -116,7 +116,7 @@ py::capsule mergeChannels3( std::vector imageList ) vectorImage->SetOrigin( images[0]->GetOrigin() ); vectorImage->SetDirection( images[0]->GetDirection() ); //vectorImage->SetNumberOfComponentsPerPixel( nImages ); - vectorImage->Allocate(); + vectorImage->AllocateInitialized(); // Fill image data itk::ImageRegionIteratorWithIndex it( vectorImage, @@ -156,7 +156,7 @@ std::vector splitChannels( py::capsule & antsimage ) image->SetSpacing( input->GetSpacing() ); image->SetOrigin( input->GetOrigin() ); image->SetDirection( input->GetDirection() ); - image->Allocate(); + image->AllocateInitialized(); images.push_back( image ); } diff --git a/ants/lib/LOCAL_simulateDisplacementField.cxx b/ants/lib/LOCAL_simulateDisplacementField.cxx index ffbae2ce..8ce19ec6 100644 --- a/ants/lib/LOCAL_simulateDisplacementField.cxx +++ b/ants/lib/LOCAL_simulateDisplacementField.cxx @@ -60,9 +60,9 @@ py::capsule simulateBsplineDisplacementField(py::capsule & antsDomainImage, antsField->CopyInformation( domainImage ); antsField->SetRegions( domainImage->GetRequestedRegion() ); antsField->SetVectorLength( Dimension ); - antsField->Allocate(); + antsField->AllocateInitialized(); - IteratorType It( bsplineSimulator->GetOutput(), + IteratorType It( bsplineSimulator->GetOutput(), bsplineSimulator->GetOutput()->GetRequestedRegion() ); for( It.GoToBegin(); !It.IsAtEnd(); ++It ) { @@ -116,9 +116,9 @@ py::capsule simulateExponentialDisplacementField(py::capsule & antsDomainImage, antsField->CopyInformation( domainImage ); antsField->SetRegions( domainImage->GetRequestedRegion() ); antsField->SetVectorLength( Dimension ); - antsField->Allocate(); + antsField->AllocateInitialized(); - IteratorType It( exponentialSimulator->GetOutput(), + IteratorType It( exponentialSimulator->GetOutput(), exponentialSimulator->GetOutput()->GetRequestedRegion() ); for( It.GoToBegin(); !It.IsAtEnd(); ++It ) { diff --git a/ants/lib/ReadWriteData.h b/ants/lib/ReadWriteData.h index c1843a76..38a3a06f 100644 --- a/ants/lib/ReadWriteData.h +++ b/ants/lib/ReadWriteData.h @@ -754,7 +754,7 @@ ConvertTimeSeriesImageToMultiChannelImage( TTimeSeriesImageType *timeSeriesImage multiChannelImage->SetOrigin( origin ); multiChannelImage->SetDirection( direction ); multiChannelImage->SetVectorLength( timeSeriesSize[ImageDimension] ); - multiChannelImage->Allocate(); + multiChannelImage->AllocateInitialized(); itk::ImageRegionIteratorWithIndex It( multiChannelImage, multiChannelImage->GetRequestedRegion() ); diff --git a/scripts/configure_ANTsPy.bat b/scripts/configure_ANTsPy.bat index ccb76ae8..546b9623 100644 --- a/scripts/configure_ANTsPy.bat +++ b/scripts/configure_ANTsPy.bat @@ -18,7 +18,7 @@ COPY data\* %USERPROFILE%\.antspy :: clone ANTs and move all files into library directory SET antsgit=https://github.com/ANTsX/ANTs.git -SET antstag=6c29d9d1d62f158ca324d5fc8786fffc469998e7 +SET antstag=2236a7589c73bbaf88c8bf34a821ba54e0e545d8 echo "ANTS;%antstag%" REM UNKNOWN: {"type":"Redirect","op":{"text":">>","type":"dgreat"},"file":{"text":"./data/softwareVersions.csv","type":"Word"}} cd ants\lib echo "123" diff --git a/scripts/configure_ANTsPy.sh b/scripts/configure_ANTsPy.sh index 99a06db2..96ed62bd 100755 --- a/scripts/configure_ANTsPy.sh +++ b/scripts/configure_ANTsPy.sh @@ -23,7 +23,7 @@ cp data/* ~/.antspy/ # clone ANTs and move all files into library directory antsgit=https://github.com/ANTsX/ANTs.git -antstag=6c29d9d1d62f158ca324d5fc8786fffc469998e7 # 3-15-24 +antstag=2236a7589c73bbaf88c8bf34a821ba54e0e545d8 # 3-20-2024 echo "ANTS;${antstag}" >> ./data/softwareVersions.csv cd ants/lib # go to lib dir diff --git a/scripts/configure_ITK.bat b/scripts/configure_ITK.bat index f4531b76..1b61a9ea 100755 --- a/scripts/configure_ITK.bat +++ b/scripts/configure_ITK.bat @@ -4,7 +4,7 @@ SET CMAKE_BUILD_TYPE=Release SET itkgit=https://github.com/InsightSoftwareConsortium/ITK.git -SET itktag=be79ceb0a9343c02dba310f5faee371941f6fa40 +SET itktag=4535548a8539757c5fe9d81f8de5d804cd0a384f :: if there is a directory but no git, remove it if exist itksource\ ( diff --git a/scripts/configure_ITK.sh b/scripts/configure_ITK.sh index e122ce5c..e3f31b88 100755 --- a/scripts/configure_ITK.sh +++ b/scripts/configure_ITK.sh @@ -15,7 +15,7 @@ fi #cd ./src itkgit=https://github.com/InsightSoftwareConsortium/ITK.git -itktag=be79ceb0a9343c02dba310f5faee371941f6fa40 # 3-15-24 +itktag=4535548a8539757c5fe9d81f8de5d804cd0a384f # 2024-03-12 # if there is a directory but no git, remove it if [[ -d itksource ]]; then if [[ ! -d itksource/.git ]]; then