Giter Club home page Giter Club logo

elastix's Introduction

elastix logo

elastix image registration toolbox

License PyPI Version GitHub Actions Model Zoo Docker

Welcome to elastix: a toolbox for rigid and nonrigid registration of images.

elastix is open source software, based on the well-known Insight Segmentation and Registration Toolkit (ITK). The software consists of a collection of algorithms that are commonly used to perform (medical) image registration: the task of finding a spatial transformation, mapping one image (the fixed image) to another (the moving image), by optimizing relevant image similarity metrics. The modular design of elastix allows the user to quickly configure, test, and compare different registration methods for a specific application. A command-line interface enables automated processing of large numbers of data sets, by means of scripting. Nowadays elastix is accompanied by ITKElastix making it available in Python (on Pypi) and by SimpleElastix, making it available in languages like C++, Python, Java, R, Ruby, C# and Lua. A docker image of the latest elastix build is available as well on dockerhub. Several plugins exist for those who wish to use the functionality of elastix in a graphical user interface, among others a napari and a 3Dslicer plugin.

Authors

The lead developers of elastix are Stefan Klein and Marius Staring. This software was initially developed at the Image Sciences Institute, under supervision of Josien P.W. Pluim. Today, many have contributed to elastix.

If you use this software anywhere we would appreciate if you cite the following articles:

  • S. Klein, M. Staring, K. Murphy, M.A. Viergever, J.P.W. Pluim, "elastix: a toolbox for intensity based medical image registration," IEEE Transactions on Medical Imaging, vol. 29, no. 1, pp. 196 - 205, January 2010. download doi
  • D.P. Shamonin, E.E. Bron, B.P.F. Lelieveldt, M. Smits, S. Klein and M. Staring, "Fast Parallel Image Registration on CPU and GPU for Diagnostic Classification of Alzheimer’s Disease", Frontiers in Neuroinformatics, vol. 7, no. 50, pp. 1-15, January 2014. download doi

Specific components of elastix are made by many; The relevant citation can be found here.

More information

More information, including an extensive manual and model zoo, can be found on the wiki

Interactive tutorials are available in Jupyter notebooks.

You can also subscribe to the mailing list for questions. Information on contributing to elastix can be found here.

elastix's People

Contributors

bartolomejka avatar blowekamp avatar bombatron avatar chrisbouwman avatar coertmetz avatar cpinter avatar darkvater avatar dpshamonin avatar dzenanz avatar ericators avatar fberendsen avatar fedorov avatar gdhugo avatar haampie avatar hortensek avatar kaspermarstal avatar lassoan avatar lxq2t avatar mstaring avatar n-dekker avatar ntatsisk avatar osemmler avatar shiruken avatar smr99 avatar stefanklein avatar thewtex avatar viktorvdvalk avatar whuizinga avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elastix's Issues

Fix AppVeyor tests

Tests using COMPARE_OVERLAP fails because ITKTools is unavailable.

The following tests genuinely fails:

  • elastix_run_3DCT_lung.SSD.bspline.ASGD.003_COMPARE_TP
  • elastix_run_3DCT_lung.SSD.bspline.ASGD.003_COMPARE_LANDMARKS
  • elastix_run_3DCT_lung.SSD.bspline.ASGD.003_OUTPUT
  • elastix_run_3DCT_lung.Kappa.bspline.ASGD.001_COMPARE_LANDMARKS
  • elastix_run_example_COMPARE_IM

Also why does elastix produce 150 tests on Windows, but 20 tests on unix-based systems?

Disabling test exit codes until this is fixed. Tests that always fails are no good - at least the CI should tell us if elastix compiles.

Missing cmake package config files

When building Elastix as library

cmake .. -DELASTIX_BUILD_EXECUTABLE:BOOL=OFF

CMake sucessfully generate files

ElastixConfig.cmake
ElastixConfigVersion.cmake
ElastixTargets.cmake

But when I try to install Elastix to install directory with

make install

these 3 files is not installed to CMAKE_INSTALL_PREFIX path.

Bug in TransformixFilter ProcessObject behavior

I think I found a bug in the transformixfilter that is causing SuperElastix to fail generating a displacement field or warped image if Fixed and Moving images have different sizes.
The root of the problem lies in the fact that the primary input of the TransformixFilter-ProcessObject is defined as the MovingImage. A call to UpdateOutputInformation() will make all TransformixFilter copy the MovingImage information to all its outputs (results image and displacement field). This is incorrect behaviour, since the information should be from the Fixed domain which is defined in the ParameterMap.

A correct implementation would be to make the ParameterMap the primary input, and to override all relevant ProcessObject methods. However this may lead to side effects I do not oversee? What do you think?

Compilation error

/home/naths/srcs/elastix/Common/CostFunctions/itkAdvancedImageToImageMetric.hxx:90:21: error:
no member named 'SetUseThreadPool' in 'itk::MultiThreaderBase'
this->m_Threader->SetUseThreadPool( false ); // setting to true makes ...


ITK (master branch from Github)
elastix (master branch from Github)

Feedback on using elastix for deformable prostate registration

We are in the process of incorporating elastix into the SliceTracker extension in 3D Slicer that we use to support in-bore targeted prostate biopsy (see publications in the extension documentation for references etc).

The registration problem we need to solve is registration between T2-weighted high-resolution scan of the prostate obtained before the procedure (typically, with the use of endo-rectal coil), and the intra-procedural T2-weighted scan of somewhat lower in-plane resolution (no endo-rectal coil).

Until now, we used registration tools included in 3D Slicer in that extension (details in this publication), but we want the software to be modular so we can experiment with the registration strategies, and we also think elastix registration might be a better registration tool anyway.

To do registration with elastix, we use an application-specific initializer (rigid alignment of the centroids of the segmented masks of the prostate and rough grid search to improve the initial pose), passing the the moving image after applying the rigid transform to elastix, and using one of the default parameter files with minimum changes. You can see the discussion and specifics on how we initialize the parameters here:

Based on the initial testing on a couple of datasets, we are getting good results. We have a reasonable-sized dataset annotated with landmarks that we next planned to use to measure TRE and compare elastix registration with the approach we are using currently for a more principled comparison. Before we do that, we would like to check with the elastix experts on whether the parameterization we use requires any modifications. Would you mind taking a glance at the parameter files, and let us know if you have any recommendations?

To be clear, things seem to work, and we have no specific problem, but we would appreciate if the elastix experts could give us the "blessing", to make sure we use it in the most optimal way, before we do the quantitative evaluation of the registration accuracy.

cc: @che85

Unavailability of the official website from Russia

I have been unsuccessfully trying to open the website of the project (http://elastix.isi.uu.nl) from Russia.
All my efforts to open this website have proved fruitless. Every time I try to open this website, the “ERR_CONNECTION_TIMED_OUT” error occurs. I have tried to open this website with IP address in St. Petersburg and Samara without any results. However, at the same time, I can easily open this website using American VPN. Could you kindly explain me why it is impossible to open this website from Russia?

about c++

how to use it in c++?I want to include it in my c++ application,

Apply transformix on very large image speed up

Hi,

I'm using elastix to perform registration on high resolution images (100000x51000). I'm performing the registration on low resolution image and applying it on the full resolution image. Evry thing work fine, but the transformix part take very much time (20 minutes). I tried to use OpenCL resampling but i'm getting buffer size error. Is there any way to speed up the resampling part of the process.

Thank you in advance.

Visual C++ 2015 Release build hangs forever, trying to compile itkGPUResampleImageFilterTest and itkGPUFactoriesTest

Currently two unit test are not possible to compile using Visual C++ 2015 (Release 64 bit) :
itkGPUResampleImageFilterTest.cxx itkGPUFactoriesTest.cxx. The issue with compilation was investigated by @N-Dekker and described here
https://discourse.itk.org/t/visual-c-2015-release-build-hangs-forever-trying-to-compile-itk-math-floor/610
see also:
https://social.msdn.microsoft.com/Forums/en-US/be92f3ae-8910-4709-9de5-4b8ba2b74968/vc-2015-x64-release-build-o2-takes-forever-trying-to-compile-mmcvtsdsi64mmsetsd?forum=vclanguage

Build pxtools with elastix

Tests currently depends on pxtools which have to be installed separately. This is a problem for CI, where some tests always fail, and for users who want to run tests.

Incorrect paths to KNN in elxCommon_INCLUDE_DIRECTORIES

https://github.com/SuperElastix/elastix/blob/develop/CMakeLists.txt#L208 says:

set( elxCommon_INCLUDE_DIRECTORIES
...
${elastix_SOURCE_DIR}/Common/KNN
${elastix_SOURCE_DIR}/Common/KNN/ann_1.1/include

These two paths are no longer there. Can they simply be removed from elxCommon_INCLUDE_DIRECTORIES?

The issue was found by CppCheck http://cppcheck.sourceforge.net which says, "Couldn't find path given by -I '...\Elastix\Common\KNN'.

By the way, KNN is currently located at elastix/Components/Metrics/KNNGraphAlphaMutualInformation

Elastix results differ depending on the input image format (.nrrd and .mha)

We have been trying to use SlicerElastix for our project and ran some tests to compare the differences between command line Elastix and Elastix via SlicerElastix in 3D Slicer. During these tests, we came across differences in results based on the image format of the input volumes and masking labels. SlicerElastix converts inputs to .mha whereas we were using .nrrd when running from command line.

Linked is an example dataset and outputs (as well as parameter files used) that demonstrate this issue. There is a text file included that describes what is contained, and how Elastix was run. The results are that running Elastix with BSpline registration succeeds and produces satisfactory results when using .nrrd format for the inputs. However, when running BSpline registration with inputs that are .mha format, the registration fails (with an “Description: itk::ERROR: AdvancedMattesMutualInformationMetric(0000026EE53C48A0): Too many samples map outside moving image buffer: 500 / 2048” error).

Link to dataset and test results: https://www.dropbox.com/sh/9pdmhsoka8l4rw6/AAC7HLIhF78q6_X8YAlx0szFa?dl=0

Compilation error with `USE_SimilarityTransformElastix`

When compiled with USE_SimilarityTransformElastix

/home/mark/git/elastix/Common/Transforms/itkAdvancedSimilarity3DTransform.hxx:103:37:   required from ‘void itk::AdvancedSimilarity3DTransform<TScalarType>::SetMatrix(const MatrixType&) [with TScalarType = double; itk::AdvancedSimilarity3DTransform<TScalarType>::MatrixType = itk::Matrix<double, 3, 3>]’
/home/mark/git/elastix/Common/Transforms/itkAdvancedSimilarity3DTransform.hxx:83:1:   required from here
/usr/include/vxl/core/vnl/vnl_math.h:175:21: error: cannot bind non-const lvalue reference of type ‘double&’ to an rvalue of type ‘double’
     return std::cbrt(std::forward<TArg>(arg));

GPUCompositeTransformCopier bug

copied from mstaring/elastix clone, mys007:

GPUCompositeTransformType should be typedefed as GPUCompositeTransform< GPUScalarType, SpaceDimension > instead of CompositeTransform< GPUScalarType, SpaceDimension > in itkGPUCompositeTransformCopier.h.

TypeError when using WriteParameterFile

Hi,

I've come across the following error when trying to use WriteParameterFile. Below is a toy example that reproduces this problem on my system.

import SimpleITK as sitk
import numpy as np

f = sitk.ElastixImageFilter()

fixedImage = sitk.GetImageFromArray(np.array([[0, 0, 1, 0, 0 ],[0, 0, 1, 0, 0],[1, 1, 1, 1, 1],[0, 0, 1, 0, 0 ],[0, 0, 1, 0, 0] ]))
movingImage = sitk.GetImageFromArray(np.array([[1, 0, 0, 0, 1 ],[0, 1, 0, 1, 0],[0, 0, 1, 0, 0],[0, 1, 0, 1, 0 ],[1, 0, 0, 0, 1] ]))

elastixImageFilter = sitk.ElastixImageFilter()
elastixImageFilter.SetFixedImage(fixedImage)
elastixImageFilter.SetMovingImage(movingImage)
elastixImageFilter.SetParameterMap(sitk.GetDefaultParameterMap("rigid"))
elastixImageFilter.Execute()

transformParameterMap = elastixImageFilter.GetTransformParameterMap()

elastixImageFilter.WriteParameterFile( transformParameterMap, "test_transform.txt" )

Here is the error that I get:

Traceback (most recent call last):
File "example.py", line 17, in
elastixImageFilter.WriteParameterFile( transformParameterMap, "test_transform.txt" )
File "/usr/local/lib/python3.6/dist-packages/SimpleITK-1.0.1rc1.dev345+g9dfa8-py3.6-linux-x86_64.egg/SimpleITK/SimpleITK.py", line 10127, in WriteParameterFile
return _SimpleITK.ElastixImageFilter_WriteParameterFile(self, parameterMap, filename)
TypeError: in method 'ElastixImageFilter_WriteParameterFile', argument 2 of type 'std::map< std::string,std::vector< std::string,std::allocator< std::string > >,std::less< std::string >,std::allocator< std::pair< std::string const,std::vector< std::string,std::allocator< std::string > > > > > const'

Not sure if it's relevant, but I'm using Ubuntu 17.10 and SWIG 3.0.

Says no mask specified when one was used

Hello everyone,

I am having an issue with supplying a mask to elastix. Whenever I supply a mask using -fmask "name.nrrd" it says in the command prompt that no mask was specified so not using one. I can supply a mask file if needed but it was generated in 3dslicer and saved as an nrrd. I am using version 4.9

Thanks

Fix CMake 3.9 warnings

Configuring the extension using the latest CMake release reports the following warnings:

CMake Deprecation Warning at src/CMakeLists.txt:7 (cmake_policy):
  The OLD behavior for policy CMP0033 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Deprecation Warning at src/CMakeLists.txt:10 (cmake_policy):
  The OLD behavior for policy CMP0007 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Warning (dev) at /home/jcfr/Software/cmake-3.9.0-Linux-x86_64/share/cmake-3.9/Modules/FindOpenMP.cmake:200 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "c" will no longer be dereferenced when the policy is
  set to NEW.  Since the policy is not set the OLD behavior will be used.
Call Stack (most recent call first):
  /home/jcfr/Software/cmake-3.9.0-Linux-x86_64/share/cmake-3.9/Modules/FindOpenMP.cmake:324 (_OPENMP_GET_FLAGS)
  src/CMakeLists.txt:95 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

OpenCL memory error CL_OUT_OF_RESOURCES

Hello,
I'm having a difficulty running registration with OpenCL, getting this error message CL_OUT_OF_RESOURCES.

The moving and fixed images are about 4MB in size. Strangely, the memory usage maxes at about 2GB (the GPU on the machine has 8GB of memory, GTX 1080) and the GPU utilization maxes at 5%. Even if I decrease the number of resolutions to make the pyramid smaller, I still get the same error message:

Description: CL_OUT_OF_RESOURCES WARNING: Unable to configure the GPU. The OpenCLFixedGenericImagePyramid is switching back to CPU mode. Error: in function: opencl_context_notify Details: OpenCL error during context creation or runtime: CL_OUT_OF_RESOURCES error executing CL_COMMAND_WRITE_BUFFER on GeForce GTX 1080 (Device 0).

Any insights on the issue?

Option to disable the iterations output

It would be nice to add an option (argument or parameter) to disable the iterations console output. I think having them in the log file is enough.
I could do this if you let me know which source files I should change.

Save transformation result as an ITK transform file

Since Elastix support has been added to 3D Slicer, we tried it many registration tasks and it works really well. However, there is one significant inconvenience: we can only save transformation as a displacement field.

Is there a way to save computed transforms as regular ITK transform file?

We prefer the .hdf5 file format that can store a sequence of transforms of any types in a single file, but a saving each into a separate file would be usable, too.

Use Elastix on large images

Hi,

I'm new on using Elastix. I'm use it on large whole slide images. I use the file parameters that i found on the database. the probleme that it take very much time to process (on the hight resolution images). Should i process the low resolution images instead and how to apply the transformation on the high resolution images after. I tried transformix and it does not apply the transformation of the low resolution on the high ones (i have a low resolution images as a result).

her is the parameters file that i used.

// Example parameter file for B-spline registration
// C-style comments: //

// The internal pixel type, used for internal computations
// Leave to float in general.
// NB: this is not the type of the input images! The pixel
// type of the input images is automatically read from the
// images themselves.
// This setting can be changed to "short" to save some memory
// in case of very large 3D images.
(FixedInternalImagePixelType "float")
(MovingInternalImagePixelType "float")

// The dimensions of the fixed and moving image
// NB: This has to be specified by the user. The dimension of
// the images is currently NOT read from the images.
// Also note that some other settings may have to specified
// for each dimension separately.
(FixedImageDimension 2)
(MovingImageDimension 2)

// Specify whether you want to take into account the so-called
// direction cosines of the images. Recommended: true.
// In some cases, the direction cosines of the image are corrupt,
// due to image format conversions for example. In that case, you
// may want to set this option to "false".
(UseDirectionCosines "true")

// **************** Main Components **************************

// The following components should usually be left as they are:
(Registration "MultiResolutionRegistration")
(Interpolator "BSplineInterpolator")
(ResampleInterpolator "FinalBSplineInterpolator")
(Resampler "DefaultResampler")

// These may be changed to Fixed/MovingSmoothingImagePyramid.
// See the manual.
(FixedImagePyramid "FixedRecursiveImagePyramid")
(MovingImagePyramid "MovingRecursiveImagePyramid")

// The following components are most important:
// The optimizer AdaptiveStochasticGradientDescent (ASGD) works
// quite ok in general. The Transform and Metric are important
// and need to be chosen careful for each application. See manual.
(Optimizer "AdaptiveStochasticGradientDescent")
(Transform "BSplineTransform")
(Metric "AdvancedMattesMutualInformation")

// ***************** Transformation **************************

// The control point spacing of the bspline transformation in
// the finest resolution level. Can be specified for each
// dimension differently. Unit: mm.
// The lower this value, the more flexible the deformation.
// Low values may improve the accuracy, but may also cause
// unrealistic deformations. This is a very important setting!
// We recommend tuning it for every specific application. It is
// difficult to come up with a good 'default' value.
(FinalGridSpacingInPhysicalUnits 16)

// Alternatively, the grid spacing can be specified in voxel units.
// To do that, uncomment the following line and comment/remove
// the FinalGridSpacingInPhysicalUnits definition.
//(FinalGridSpacingInVoxels 16)

// By default the grid spacing is halved after every resolution,
// such that the final grid spacing is obtained in the last
// resolution level. You can also specify your own schedule,
// if you uncomment the following line:
//(GridSpacingSchedule 4.0 4.0 2.0 1.0)
// This setting can also be supplied per dimension.

// Whether transforms are combined by composition or by addition.
// In generally, Compose is the best option in most cases.
// It does not influence the results very much.
(HowToCombineTransforms "Compose")

// ******************* Similarity measure *********************

// Number of grey level bins in each resolution level,
// for the mutual information. 16 or 32 usually works fine.
// You could also employ a hierarchical strategy:
//(NumberOfHistogramBins 16 32 64)
(NumberOfHistogramBins 32)

// If you use a mask, this option is important.
// If the mask serves as region of interest, set it to false.
// If the mask indicates which pixels are valid, then set it to true.
// If you do not use a mask, the option doesn't matter.
(ErodeMask "false")

// ******************** Multiresolution **********************

// The number of resolutions. 1 Is only enough if the expected
// deformations are small. 3 or 4 mostly works fine. For large
// images and large deformations, 5 or 6 may even be useful.
(NumberOfResolutions 3)

// The downsampling/blurring factors for the image pyramids.
// By default, the images are downsampled by a factor of 2
// compared to the next resolution.
// So, in 2D, with 4 resolutions, the following schedule is used:
//(ImagePyramidSchedule 8 8 4 4 2 2 1 1 )
// And in 3D:
//(ImagePyramidSchedule 8 8 8 4 4 4 2 2 2 1 1 1 )
// You can specify any schedule, for example:
//(ImagePyramidSchedule 4 4 4 3 2 1 1 1 )
// Make sure that the number of elements equals the number
// of resolutions times the image dimension.

// ******************* Optimizer ****************************

// Maximum number of iterations in each resolution level:
// 200-2000 works usually fine for nonrigid registration.
// The more, the better, but the longer computation time.
// This is an important parameter!
(MaximumNumberOfIterations 200)

// The step size of the optimizer, in mm. By default the voxel size is used.
// which usually works well. In case of unusual high-resolution images
// (eg histology) it is necessary to increase this value a bit, to the size
// of the "smallest visible structure" in the image:
//(MaximumStepLength 1.0)

// **************** Image sampling **********************

// Number of spatial samples used to compute the mutual
// information (and its derivative) in each iteration.
// With an AdaptiveStochasticGradientDescent optimizer,
// in combination with the two options below, around 2000
// samples may already suffice.
(NumberOfSpatialSamples 2048)

// Refresh these spatial samples in every iteration, and select
// them randomly. See the manual for information on other sampling
// strategies.
(NewSamplesEveryIteration "true")
(ImageSampler "Random")

// ************* Interpolation and Resampling ****************

// Order of B-Spline interpolation used during registration/optimisation.
// It may improve accuracy if you set this to 3. Never use 0.
// An order of 1 gives linear interpolation. This is in most
// applications a good choice.
(BSplineInterpolationOrder 3)

// Order of B-Spline interpolation used for applying the final
// deformation.
// 3 gives good accuracy; recommended in most cases.
// 1 gives worse accuracy (linear interpolation)
// 0 gives worst accuracy, but is appropriate for binary images
// (masks, segmentations); equivalent to nearest neighbor interpolation.
(FinalBSplineInterpolationOrder 3)

//Default pixel value for pixels that come from outside the picture:
(DefaultPixelValue 0)

// Choose whether to generate the deformed moving image.
// You can save some time by setting this to false, if you are
// not interested in the final deformed moving image, but only
// want to analyze the deformation field for example.
(WriteResultImage "false")

// The pixel type and format of the resulting deformed moving image
(ResultImagePixelType "unsigned char")
(ResultImageFormat "tiff")

Thank you in advanced.

Windows build fails due to long name of ReducedDimensionBSplineResampleInterpolator component

For Visual Studio builds, length of file paths, solution name, and project name are limited. It's not a simple number: for example, for VS2005 this sum must be less than 260:
Path length + 1 (separator) +
Solution name length + 1 (separator) +
Project name length + 1 (separator) +
Project name length +
80 (Reserved space)
(https://social.msdn.microsoft.com/Forums/en-US/d614d0ba-eea2-444b-9be8-7fe4fb85a226/problem-re-path-length-allowed-for-new-project-in-vs2005?forum=csharpide - there are similar limits for newer versions, too, but I could not find the exact formula).

ReducedDimensionBSplineResampleInterpolator component has both an extremely long project name, directory path, and file names, which causes build failure on Windows (except if the base path is very short).

Would it be possible to rename this component and file names to something shorter?

For example renaming ReducedDimensionBSplineResampleInterpolator directory to RDBSplineResampleInterpolator fixes the build error on our nightly build machine (where Elastix is made available as a Slicer extension). Now we apply this patch locally, but it would be nice to have a solution in the official repository (it would make our build system simpler and would reduce the chance that other Elastix users run into the same issue).

Installation failed due to non-existing files

When trying to install I get the following error:

CMake Error at Core/cmake_install.cmake:88 (file):
file INSTALL cannot find
"[PATH TO ELASTIX]/build/ITKIOFactoryRegistration/itkImageIOFactoryRegisterManager.h".
Call Stack (most recent call first):
cmake_install.cmake:39 (include)

Changing the line 245 in Core/CMakeLists.txt:
${elastix_BINARY_DIR}/ITKIOFactoryRegistration/itkImageIOFactoryRegisterManager.h
to
${elastix_BINARY_DIR}/ITKFactoryRegistration/itkImageIOFactoryRegisterManager.h

and the line below accordingly, solves the problem for me.

How to use elastix in C++ application?

How to use transformix to create .vtk file?

TRANSFORMIX* transformix = new TRANSFORMIX();
int errorTransformix = transformix->TransformImage(elastix->GetResultImage().GetPointer() , transform_parameters, "OutputDirectory/", true, true);

By this , I only get imageType

Error building with OpenCL

Hello, I'm trying to build elastix with OpenCL support, but I'm having a trouble (on this note, is there any instruction on how to build with OpenCL?) Please see below for the error message. I'm using ITK 5.0, gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609, cmake (tried both 3.5.1 and 3.11.3) on Ubuntu 16.04. Thanks in advance!

CMakeFiles/Makefile2:1611: recipe for target 'Common/OpenCL/CMakeFiles/elxOpenCL.dir/all' failed
make[1]: *** [Common/OpenCL/CMakeFiles/elxOpenCL.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 18%] Building CXX object Core/CMakeFiles/elxCore.dir/Install/elxComponentDatabase.cxx.o
[ 18%] Building CXX object Core/CMakeFiles/elxCore.dir/Kernel/elxElastixBase.cxx.o
[ 18%] Building CXX object Core/CMakeFiles/elxCore.dir/Install/elxBaseComponent.cxx.o
[ 18%] Building CXX object Core/CMakeFiles/elxCore.dir/Configuration/elxConfiguration.cxx.o
[ 18%] Building CXX object Core/CMakeFiles/elxCore.dir/elxProgressCommand.cxx.o
[ 18%] Linking CXX executable ../bin/elxComputeOverlap
[ 18%] Linking CXX executable ../bin/elxImageCompare
[ 18%] Built target elxComputeOverlap
[ 19%] Linking CXX static library ../bin/libelxCore-4.9.a
[ 19%] Built target elxCore
[ 19%] Built target elxImageCompare
[ 19%] Linking CXX executable ../bin/elxTransformParametersCompare
[ 19%] Linking CXX executable ../bin/elxInvertTransform
[ 19%] Built target elxTransformParametersCompare
[ 19%] Built target elxInvertTransform
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

Request: improve ElastixConfig for downstream packaging

Hi, it seems that ElastixConfig.cmake is generated using the buildtime location of the source, and not with the install time locations of the directories.

It would be good if you could help generate the output of the files such that they point to their install locations.

Output Transformation Parameters units

Hi,
I performed an Euler transformation on a 2D image and as expected I received as output a file including 3 parameters regarding angle and translation.

I was wondering if translation components have some kind of scaling factor because the translation applied (verified by visualizing the output image using ITK-snap) seems much bigger than the values tx and ty.
I was expecting a horizontal transformation of ~ [50-100] to the left and the output parameters I got are:
-0.004941 -4.089170 -1.028161

So, my question is: what are the units for tx and ty?

Thanks,
Francisco Cunha

Registration problem with Windows 10

Hi everyone,
I don't know if this is the right place to ask this question. I found some problems with the use of elastix. I tried to make some easy registrations to understand how to set the parameters file but, every time I tried, the result image was equal to the moving image without colors ( I was expected to have a result image similar to first with the colors )

I used some different configurations but the result is more or less the same. I worked with images that where rotate by 90/180/270 degrees each other and I have used "EulerTransform" e "AffineTransform".

What did I do wrong?

Exact metric not returning value

Hello, I am trying to determine if the current registration I am preforming is converging. I turned on the exact metric to true but it is just returning "-nan(ind)" Here is the code of my parameter file thanks for your time!

(FixedInternalImagePixelType "float")
(MovingInternalImagePixelType "float")
(FixedImageDimension 3)
(MovingImageDimension 3)
(UseDirectionCosines "true")

// **************** Main Components **************************

(Registration "MultiMetricMultiResolutionRegistration")
(Interpolator "BSplineInterpolator")
(ResampleInterpolator "FinalBSplineInterpolator")
(Resampler "DefaultResampler")

(FixedImagePyramid "FixedSmoothingImagePyramid")
(MovingImagePyramid "MovingSmoothingImagePyramid")

(Optimizer "AdaptiveStochasticGradientDescent")
(Transform "RecursiveBSplineTransform")
(Metric "AdvancedMattesMutualInformation" "TransformBendingEnergyPenalty")
//(Metric "PCAMetric2" "TransformBendingEnergyPenalty")
(Metric0Weight 1)
(Metric1Weight 50) // OPTIMIZED BY QUANTITATIVE MEASURES

// ***************** Transformation **************************

(GridSpacingSchedule 4 2 1)
(FinalGridSpacingInPhysicalUnits 10 10 10)
(HowToCombineTransforms "Compose")

// ******************* Similarity measure *********************

(NumberOfHistogramBins 100) // OPTIMIZED BY QUANTITATIVE MEASURES

// ******************** Multiresolution **********************

(NumberOfResolutions 3)
(ImagePyramidSchedule 8 8 8  4 4 4  1 1 1 1 1 1) // ACCOUNTING FOR ANISOTROPIC RESOLUTION

// ******************* Optimizer ****************************

(MaximumNumberOfIterations 3000) // COULD PROBABLY BE LOWERED, ESPECIALLY FOR THE FIRST LEVELS OF THE IMAGE PYRAMID

// **************** Image sampling **********************

(NumberOfSpatialSamples 10000) // COULD PROBABLY BE LOWERED, ESPECIALLY FOR THE FIRST LEVELS OF THE IMAGE PYRAMID
(NewSamplesEveryIteration "true")
(ImageSampler "MultiInputRandomCoordinate")
(SampleRegionSize 40)  // OPTIMIZED BY QUANTITATIVE MEASURES
(UseRandomSampleRegion "true")
(MaximumNumberOfSamplingAttempts 10)
(RequiredRatioOfValidSamples 0.05)

// ************* Interpolation and Resampling ****************

(BSplineInterpolationOrder 1)
(FinalBSplineInterpolationOrder 3)

(ShowExactMetricValue "false" "false" "true") 
(WriteTransformParametersEachResolution "true")
(WriteResultImageAfterEachResolution "true")
//(WritePyramidImagesAfterEachResolution "true")

(DefaultPixelValue 0)
(WriteResultImage "true")
(ResultImagePixelType "short")
(ResultImageFormat "nrrd")

can not view the resulted png image

OS: Ubuntu 16.04

I tried to register two png images. I used (ResultImageFormat "png").
The registration works but I can not view the resulted png image. I can view the result using (ResultImageFormat "nrrd") in 3D Slicer.

Including elastix by another project failed

When trying to include elastix by another project the following cmake error occurs:

-- Including Elastix settings.
CMake Error at src/elastix/build/UseElastix.cmake:25 (include):
include called with wrong number of arguments. include() only takes one
file.
Call Stack (most recent call first):
CMakeLists.txt:273 (INCLUDE)

with the following include by the other project:
SET(ELASTIX_BINARY_DIR [PATH TO ELASTIX]/build)
SET( ELASTIX_USE_FILE ${ELASTIX_BINARY_DIR}/UseElastix.cmake )
INCLUDE( ${ELASTIX_USE_FILE} )

Including the following line at the beginning of the file build/UseElastix.cmake solves the problem for me:
include( [PATH TO ELASTIX]/build/ElastixConfig.cmake )

Maybe you want to change UseElastix.cmake.in with appropriate cmake variables to keep it general?

multiple Elastix instances/runs ignore `RandomSeed` in ParameterFile

As instructed (SuperElastix/SimpleElastix#122 (comment)) here the port of the issue from SimpleElastix (SuperElastix/SimpleElastix#122) which seems to be an Elastix issue:

It seems (Simple)Elastix ignores RandomSeed set in ParameterList if run multiple times.
Even though I set RandomSeed in the ParameterFile, and initialize each Elastix instance with the very same ParameterFile (pM), Elastix seems not to (re-) set its random seed accordingly. See e.g. these test results from selx: romangrothausmann/elastix_scripts@d2d6d04?diff=split#diff-2e0a2595b81a2453a02093ffede7ec7dL1

The first metric value (107.81864) stays the same but the second run of selx yields 99.225277 even though both run with "NoInitialTransform" and the same ParameterFile. It also changes the metric values for all following runs.

Note that the metric value for the second image pair (L2) changes back to its original value (60.185559) if the first image pair only uses one selx run: romangrothausmann/elastix_scripts@d06bd99#diff-2e0a2595b81a2453a02093ffede7ec7dR2

So it seems to me that selx initializes its RNG with a fixed random seed (121212 by default or that given by RandomSeed in ParameterFile) only once but not for every new instance/run even if the ParameterFile stays the same (and one would expect the RandomSeed to be reset again).

OpenCL GPU registration

Hi guys,

I want to use the GPU acceleration of elastix. But I have difficulties to getting it to work.

I use ITK 4.8.2 compiled with gcc 4.4.7:
Module_ITKReview: ON
ITK_USE_64BITS_IDS: ON
ITK_LEGACY_REMOVE: ON
ITK_USE_GPU: ON

I used gcc 4.4.7 for compilation of elastix.

I compiled elastix with:
ELASTIX_USE_OPENCL: ON
USE_OpenCLFixedGenericPyramid: ON
USE_OpenCLMovingGenericPyramid: ON
USE_OpenCLResampler: ON
OPENCL_C_VERSION_1_2: ON
OPENCL_INCLUDE_DIRS: /usr/local/cuda/include
OPENCL_LIBRARIES: /usr/local/cuda/lib64/libOpenCL.so
OPENCL_OPTIMIZATION_MAD_ENABLE: ON
OPENCL_USENVIDIA_SDK: ON
USE_AffineDTITransformElastix: ON
USE_DisplacementMagnitudePenalty: ON

I tested an Nvidia Quadro K620 with cuda 6.5/7.0/7.5
Also a GTX 1080 with cuda 8.0
Driver from Nvidia: 375.66

When I compile and test the elastix v4.8 source I get the following output, regardless of the cuda version. Also when I run the registration using the GPU I get the same "malloc(): memory corruption:" exception.

Start 1: InvertTransformTest_OUTPUT
1/58 Test #1: InvertTransformTest_OUTPUT ............................. Passed 0.08 sec
Start 2: InvertTransformTest_COMPARE_TP
2/58 Test #2: InvertTransformTest_COMPARE_TP ......................... Passed 0.07 sec
Start 3: AdvancedBSplineDeformableTransformTest
3/58 Test #3: AdvancedBSplineDeformableTransformTest ................. Passed 3.82 sec
Start 4: AdvancedLinearInterpolatorTest
4/58 Test #4: AdvancedLinearInterpolatorTest ......................... Passed 0.36 sec
Start 5: BSplineDerivativeKernelFunctionTest
5/58 Test #5: BSplineDerivativeKernelFunctionTest .................... Passed 3.23 sec
Start 6: BSplineSODerivativeKernelFunctionTest
6/58 Test #6: BSplineSODerivativeKernelFunctionTest .................. Passed 1.38 sec
Start 7: BSplineInterpolationWeightFunctionTest
7/58 Test #7: BSplineInterpolationWeightFunctionTest ................. Passed 0.43 sec
Start 8: BSplineInterpolationDerivativeWeightFunctionTest
8/58 Test #8: BSplineInterpolationDerivativeWeightFunctionTest ....... Passed 0.96 sec
Start 9: BSplineInterpolationSODerivativeWeightFunctionTest
9/58 Test #9: BSplineInterpolationSODerivativeWeightFunctionTest ..... Passed 0.21 sec
Start 10: CompareCompositeTransformsTest
10/58 Test #10: CompareCompositeTransformsTest ......................... Passed 0.02 sec
Start 11: MevisDicomTiffImageIOTest
11/58 Test #11: MevisDicomTiffImageIOTest .............................. Passed 0.03 sec
Start 12: ThinPlateSplineTransformPerformanceTest
12/58 Test #12: ThinPlateSplineTransformPerformanceTest ................ Passed 3.18 sec
Start 13: ThinPlateSplineTransformTest
13/58 Test #13: ThinPlateSplineTransformTest ........................... Passed 0.30 sec
Start 14: AdvanceOneStepParallellizationTest
14/58 Test #14: AdvanceOneStepParallellizationTest ..................... Passed 0.32 sec
Start 15: AccumulateDerivativesParallellizationTest
15/58 Test #15: AccumulateDerivativesParallellizationTest .............. Passed 1.92 sec
Start 16: BSplineTransformPointPerformanceTest
16/58 Test #16: BSplineTransformPointPerformanceTest ................... Passed 0.46 sec
Start 17: BSplineJacobianGradientPerformanceTest
17/58 Test #17: BSplineJacobianGradientPerformanceTest ................. Passed 1.16 sec
Start 18: OpenCLBufferTest
18/58 Test #18: OpenCLBufferTest ....................................... Passed 0.35 sec
Start 19: OpenCLContextTest
19/58 Test #19: OpenCLContextTest ...................................... Passed 0.34 sec
Start 20: OpenCLDeviceTest
20/58 Test #20: OpenCLDeviceTest ....................................... Passed 0.04 sec
Start 21: OpenCLEventTest
21/58 Test #21: OpenCLEventTest ........................................ Passed 0.37 sec
Start 22: OpenCLImageTest
22/58 Test #22: OpenCLImageTest ........................................ Passed 0.35 sec
Start 23: OpenCLKernelManagerTest
23/58 Test #23: OpenCLKernelManagerTest ................................ Passed 0.36 sec
Start 24: OpenCLKernelTest
24/58 Test #24: OpenCLKernelTest ....................................... Passed 0.04 sec
Start 25: OpenCLKernelToImageBridgeTest
25/58 Test #25: OpenCLKernelToImageBridgeTest .......................... Passed 0.37 sec
Start 26: OpenCLPlatformTest
26/58 Test #26: OpenCLPlatformTest ..................................... Passed 0.04 sec
Start 27: OpenCLProfilingTimeProbeTest
27/58 Test #27: OpenCLProfilingTimeProbeTest ........................... Passed 0.04 sec
Start 28: OpenCLSamplerTest
28/58 Test #28: OpenCLSamplerTest ...................................... Passed 0.36 sec
Start 29: OpenCLSimpleTest
29/58 Test #29: OpenCLSimpleTest ....................................... Passed 0.72 sec
Start 30: OpenCLSizeTest
30/58 Test #30: OpenCLSizeTest ......................................... Passed 0.36 sec
Start 31: OpenCLStringUtilsTest
31/58 Test #31: OpenCLStringUtilsTest .................................. Passed 0.02 sec
Start 32: OpenCLVectorTest
32/58 Test #32: OpenCLVectorTest ....................................... Passed 0.40 sec
Start 33: GPUFactoriesTest
33/58 Test #33: GPUFactoriesTest ....................................... Passed 0.39 sec
Start 34: GPUBSplineDecompositionImageFilterTest
34/58 Test #34: GPUBSplineDecompositionImageFilterTest .................***Failed 1.26 sec
Start 35: GPUCastImageFilterTest
35/58 Test #35: GPUCastImageFilterTest .................................***Failed 0.78 sec
Start 36: GPUShrinkImageFilterTest
36/58 Test #36: GPUShrinkImageFilterTest ...............................***Failed 0.76 sec
Start 37: GPURecursiveGaussianImageFilterTest
37/58 Test #37: GPURecursiveGaussianImageFilterTest ....................***Exception: Other 1.15 sec
Start 38: GPUSmoothingRecursiveGaussianImageFilterTest
38/58 Test #38: GPUSmoothingRecursiveGaussianImageFilterTest ...........***Failed 0.84 sec
Start 39: GPUGenericMultiResolutionPyramidImageFilterTest
*** Error in /home/christophers2/Desktop/software/elastix-build/bin/itkGPUGenericMultiResolutionPyramidImageFilterTest': malloc(): memory corruption: 0x000000000532ba90 *** 39/58 Test #39: GPUGenericMultiResolutionPyramidImageFilterTest ........***Exception: Other 1.08 sec Start 40: GPUResampleImageFilterTest-NearestAffine *** Error in /home/christophers2/Desktop/software/elastix-build/bin/itkGPUResampleImageFilterTest': malloc(): memory corruption: 0x0000000004644d10 ***
40/58 Test #40: GPUResampleImageFilterTest-NearestAffine ...............***Exception: Other 0.86 sec
Start 41: GPUResampleImageFilterTest-LinearAffine
*** Error in /home/christophers2/Desktop/software/elastix-build/bin/itkGPUResampleImageFilterTest': malloc(): memory corruption: 0x000000000464ad00 *** 41/58 Test #41: GPUResampleImageFilterTest-LinearAffine ................***Exception: Other 0.90 sec Start 42: GPUResampleImageFilterTest-BSplineAffine *** Error in /home/christophers2/Desktop/software/elastix-build/bin/itkGPUResampleImageFilterTest': malloc(): memory corruption: 0x0000000004f363c0 ***
42/58 Test #42: GPUResampleImageFilterTest-BSplineAffine ...............***Exception: Other 1.14 sec
Start 43: GPUResampleImageFilterTest-NearestTranslation
*** Error in /home/christophers2/Desktop/software/elastix-build/bin/itkGPUResampleImageFilterTest': malloc(): memory corruption: 0x00000000044adcb0 *** 43/58 Test #43: GPUResampleImageFilterTest-NearestTranslation ..........***Exception: Other 0.82 sec Start 44: GPUResampleImageFilterTest-LinearTranslation *** Error in /home/christophers2/Desktop/software/elastix-build/bin/itkGPUResampleImageFilterTest': malloc(): memory corruption: 0x0000000003eb2cf0 ***
44/58 Test #44: GPUResampleImageFilterTest-LinearTranslation ...........***Exception: Other 0.92 sec
Start 45: GPUResampleImageFilterTest-BSplineTranslation
*** Error in /home/christophers2/Desktop/software/elastix-build/bin/itkGPUResampleImageFilterTest': malloc(): memory corruption: 0x0000000003c703d0 *** 45/58 Test #45: GPUResampleImageFilterTest-BSplineTranslation ..........***Exception: Other 1.13 sec Start 46: GPUResampleImageFilterTest-NearestBSpline *** Error in /home/christophers2/Desktop/software/elastix-build/bin/itkGPUResampleImageFilterTest': malloc(): memory corruption: 0x00000000041f2dc0 ***
46/58 Test #46: GPUResampleImageFilterTest-NearestBSpline ..............***Exception: Other 1.26 sec
Start 47: GPUResampleImageFilterTest-LinearBSpline
*** Error in /home/christophers2/Desktop/software/elastix-build/bin/itkGPUResampleImageFilterTest': malloc(): memory corruption: 0x00000000048dfe20 *** 47/58 Test #47: GPUResampleImageFilterTest-LinearBSpline ...............***Exception: Other 1.35 sec Start 48: GPUResampleImageFilterTest-BSplineBSpline *** Error in /home/christophers2/Desktop/software/elastix-build/bin/itkGPUResampleImageFilterTest': malloc(): memory corruption: 0x0000000004ac74f0 ***
48/58 Test #48: GPUResampleImageFilterTest-BSplineBSpline ..............***Exception: Other 1.64 sec
Start 49: GPUResampleImageFilterTest-NearestEuler
*** Error in /home/christophers2/Desktop/software/elastix-build/bin/itkGPUResampleImageFilterTest': malloc(): memory corruption: 0x0000000004278cd0 *** 49/58 Test #49: GPUResampleImageFilterTest-NearestEuler ................***Exception: Other 0.77 sec Start 50: GPUResampleImageFilterTest-LinearEuler *** Error in /home/christophers2/Desktop/software/elastix-build/bin/itkGPUResampleImageFilterTest': malloc(): memory corruption: 0x0000000004a9fce0 ***
50/58 Test #50: GPUResampleImageFilterTest-LinearEuler .................***Exception: Other 0.96 sec
Start 51: GPUResampleImageFilterTest-BSplineEuler
*** Error in /home/christophers2/Desktop/software/elastix-build/bin/itkGPUResampleImageFilterTest': malloc(): memory corruption: 0x0000000003f4b3c0 *** 51/58 Test #51: GPUResampleImageFilterTest-BSplineEuler ................***Exception: Other 1.09 sec Start 52: GPUResampleImageFilterTest-NearestSimilarity *** Error in /home/christophers2/Desktop/software/elastix-build/bin/itkGPUResampleImageFilterTest': malloc(): memory corruption: 0x0000000003d9fce0 ***
52/58 Test #52: GPUResampleImageFilterTest-NearestSimilarity ...........***Exception: Other 0.77 sec
Start 53: GPUResampleImageFilterTest-LinearSimilarity
*** Error in /home/christophers2/Desktop/software/elastix-build/bin/itkGPUResampleImageFilterTest': malloc(): memory corruption: 0x000000000387ad60 *** 53/58 Test #53: GPUResampleImageFilterTest-LinearSimilarity ............***Exception: Other 0.96 sec Start 54: GPUResampleImageFilterTest-BSplineSimilarity *** Error in /home/christophers2/Desktop/software/elastix-build/bin/itkGPUResampleImageFilterTest': malloc(): memory corruption: 0x0000000005076420 ***
54/58 Test #54: GPUResampleImageFilterTest-BSplineSimilarity ...........***Exception: Other 1.18 sec
Start 55: GPUResampleImageFilterTest-NearestComboAffine
*** Error in /home/christophers2/Desktop/software/elastix-build/bin/itkGPUResampleImageFilterTest': malloc(): memory corruption: 0x00000000041027b0 *** 55/58 Test #55: GPUResampleImageFilterTest-NearestComboAffine ..........***Exception: Other 0.81 sec Start 56: GPUResampleImageFilterTest-NearestComboBSpline *** Error in /home/christophers2/Desktop/software/elastix-build/bin/itkGPUResampleImageFilterTest': malloc(): memory corruption: 0x0000000003bd4b00 ***
56/58 Test #56: GPUResampleImageFilterTest-NearestComboBSpline .........***Exception: Other 0.96 sec
Start 57: GPUResampleImageFilterTest-NearestComboAffineBSpline
*** Error in `/home/christophers2/Desktop/software/elastix-build/bin/itkGPUResampleImageFilterTest': malloc(): memory corruption: 0x0000000003f17700 ***
57/58 Test #57: GPUResampleImageFilterTest-NearestComboAffineBSpline ...***Exception: Other 0.88 sec
Start 58: TransformixMemoryTest
58/58 Test #58: TransformixMemoryTest .................................. Passed 0.63 sec

59% tests passed, 24 tests failed out of 58

Total Test time (real) = 47.42 sec

The following tests FAILED:
34 - GPUBSplineDecompositionImageFilterTest (Failed)
35 - GPUCastImageFilterTest (Failed)
36 - GPUShrinkImageFilterTest (Failed)
37 - GPURecursiveGaussianImageFilterTest (OTHER_FAULT)
38 - GPUSmoothingRecursiveGaussianImageFilterTest (Failed)
39 - GPUGenericMultiResolutionPyramidImageFilterTest (OTHER_FAULT)
40 - GPUResampleImageFilterTest-NearestAffine (OTHER_FAULT)
41 - GPUResampleImageFilterTest-LinearAffine (OTHER_FAULT)
42 - GPUResampleImageFilterTest-BSplineAffine (OTHER_FAULT)
43 - GPUResampleImageFilterTest-NearestTranslation (OTHER_FAULT)
44 - GPUResampleImageFilterTest-LinearTranslation (OTHER_FAULT)
45 - GPUResampleImageFilterTest-BSplineTranslation (OTHER_FAULT)
46 - GPUResampleImageFilterTest-NearestBSpline (OTHER_FAULT)
47 - GPUResampleImageFilterTest-LinearBSpline (OTHER_FAULT)
48 - GPUResampleImageFilterTest-BSplineBSpline (OTHER_FAULT)
49 - GPUResampleImageFilterTest-NearestEuler (OTHER_FAULT)
50 - GPUResampleImageFilterTest-LinearEuler (OTHER_FAULT)
51 - GPUResampleImageFilterTest-BSplineEuler (OTHER_FAULT)
52 - GPUResampleImageFilterTest-NearestSimilarity (OTHER_FAULT)
53 - GPUResampleImageFilterTest-LinearSimilarity (OTHER_FAULT)
54 - GPUResampleImageFilterTest-BSplineSimilarity (OTHER_FAULT)
55 - GPUResampleImageFilterTest-NearestComboAffine (OTHER_FAULT)
56 - GPUResampleImageFilterTest-NearestComboBSpline (OTHER_FAULT)
57 - GPUResampleImageFilterTest-NearestComboAffineBSpline (OTHER_FAULT)
Errors while running CTest

What do I do wrong?

Thank you!
Christopher

Cmake solution and openCL release 4.9.0

When i build the elastix 4.9 release with OPENCL = True Cmake generates a wrong elxOenCL.vcxproj file that results in a load fail of the elxOpenCL solution

..\Common\OpenCL\elxOpenCL.vcxproj : error : File ..\Common\OpenCL\CMakeLists.txt is included into CustomBuild and None item groups. This is not allowed for project items, which can belong to only one item group.

It has to do with this line being added in elxOenCL.vcxproj, after removing it the solution loads and compiles without errors.
<None Include="..\Common\OpenCL\CMakeLists.txt" />

GPU memory leak from direct elastix call with OpenCL on

I have extended the ElastixImageFilter with OpenCLResampler included in the original Elastix repo. When using itkGPUImage, the GPU memory will not be released since the reference counter is always set to at least 2. One ref is from the GPUImage itself, but the other ref is coming from the internal GPUImageDataManager inside the class (with SetImagePointer call ), which leads to a recurrent smart pointer counter. And the itkGPUImage allocated will never be released until the whole programme exits.

I have simply altered the SetImagePointer signature to allow this method accept normal pointers but not smart pointer to avoid reference increment. Not sure if this is the best solution, but it surely is the simplest.

I believe this should be some bug to the original Elastix package, however I do not find any issue reporting for this package on Github, therefore I place it here to someone who may encounter the same problem.

P.S.

The usual CPU image (itk::Image) works well, this can be observed by the Print function after image allocation. Typically, when you allocate a new itk::Image the default reference count is 1, and the image would be releases out of function scope. Meanwhile, when you allocate a new itk::GPUImage, the ref count is exactly the same 1, but after graft data using methods like GraftITK from CPU itk Images, the ref count is set as 2, in which the 2nd ref is set by GPUImageDataManager, making the GPU image not properly released.

Format of the output deformable vector field (DVF)

Dear all,

I run the deformable image registration toolbox and have the file. (result.0.raw, result.0.mhd & TransformParameters.0.txt)
I wonder if there is any document that described the format of the output DVF.
Thank you.

Shupeng

Build error when using ITK thirdparty modules

When ITK_BUILD_DEFAULT_MODULES off, ITKGroup_ThirdParty ON, elastix build will meet this build error
\elastix\src\common\itkMeshFileReaderBase.h(23) : fatal error C1083: Cannot open include file: 'itkMeshFileReader.h': No such file or directory
#include "itkMeshFileReader.h" // for MeshFileReaderException
When using ITK_BUILD_DEFAULT_MODULES ON, everything is ok.
Maybe this is a small problem, however, I should report it if someone also meets it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.