Feel free to leave any comments or questions here!

 

71 Responses to Forum

  1. Huaiqiang Sun says:

    Could you please provide some details on affine registration of 3D shape sets, Thanks!

    • Stanley Durrleman says:

      Hello! Deformetrica does not provided tools for affine registration (yet). It implements non-linear deformations only. One assumes that the 3D shape sets, which you give as input of Deformetrica, are already rigidly/affinely registered. If shapes come from images, you can register those images (using SPM or FSL, for instance) and then apply the affine transform to your shapes. Hope this helps.

      • Huaiqiang Sun says:

        Thank you so much for your kind reply. I have got the affine matrix from images registration using FSL. but I have no idea on applying the matrix to VTK polydata(.vtk file). I am not a VTK programmer, could you please give me some hint?

        • Alexandre Routier says:

          Hello! Could you tell us how you obtained your meshes (FSL, FreeSurfer,..)? Because you might encounter problems with referentials.. But to answer your question, you can use the matlab utilities available in Deformetrica, use VTKPolyDataReader to load the points, deform them using the matrix obtained with FSL and eventually save the deformed points into a new vtk file using VTKPolyDataWriter.

          • Huaiqiang Sun says:

            Thanks, Alexandre. I use FSL FIRST to get the meshs of subcortical structures. And the affine registration was performed using FSL flirt with 6DOF. Is there anything I should note before applying the transform matrix to the mesh?

          • Alexandre Routier says:

            If you were using FreeSurfer to get your meshes, we would tell you how to deal with orientation problems but I never experimented affine deformation from FLIRT on FSL meshes, only on FreeSurfer meshes. So apply the affine deformation on your meshes and check carefully the results just in case.

  2. Huaiqiang Sun says:

    Thanks for your help. I have successfully applying the affine matrix to the mesh generated from FSL FIRST. However, I have a doubt, can we ensure that all the mesh are rigid registered if the original images are rigid registered?

    • Alexandre Routier says:

      Since you have specified 6 DOF with FLIRT, your meshes will be rigidly aligned. 😉

      • Huaiqiang Sun says:

        Sorry to bother you again, I switched to freesurfer as FIRST is not good in some cases, could you please tell me how to deal with orientation problems of mesh generate from freesurfer? Thanks!

      • Huaiqiang Sun says:

        Another problem I met is when I construct atlas with some subjects, the construction finished very quick, and the input prototype failed to deform, all the MOM is 0. all the mesh were rigid registered, however, when I switch to another subset of samples, the processing may success.

        • Alexandre Routier says:

          Hello! Could you contact us on our mail address and give us more details on your atlas construction (a log of the program would be great to understand what your problem is). We will answer concerning the orientation problems with FreeSurfer you may occur as well. Alexandre

  3. Foubet says:

    Hello,

    Thank you very much for this amazing software !
    It ran perfectly with previous data but I just came with an issue. I have tried to apply “sparsematching3” to 2 3D brain meshes. The meshes were perfectly aligned and had around 10000 vertices.
    I kept the default parameters except for the “kernel-width” that was 6 in the “paramDiffeos” file.
    I got all the output files expected, however all the output meshes.vtk are identical: i saw in the log that it ran just for the first iteration… Do you have an idea of the problem ?

    Here the log:
    Sparse diffeomorphic matching
    ===
    Number of objects detected: 1

    ===

    Deformations Parameters:
    Kernel width = 10

    Kernel type = p3m
    P3M working spacing ratio = 0.2
    P3M padding factor = 3

    Number of time points = 10
    Initial CP spacing = 0
    Freeze CP = Off
    Initial set of CP loaded from
    Initial momenta loaded from

    Sparsity prior = 0

    SmoothingKernelWidthRatio = 1
    Optimization method: F_ISTA
    Max descent iterations = 100
    Max line search iterations = 10
    Step expand = 2
    Step shrink = 0.5
    Adaptive tolerance = 0.0001
    Initial step multiplier = 10
    Number of threads = 1

    ===

    Object 0:
    Source file: /pasteur/homes/ofoubet/2014_07Deformetrica_modBear/input/erosion-02-tp-smooth.vtk
    Target file: /pasteur/homes/ofoubet/2014_07Deformetrica_modBear/input/Sloth_bear-1931_sel_lr.vtk
    Deformable object type: NonOrientedSurfaceMesh
    Data sigma = 0.5

    Kernel type = p3m
    Kernel width = 2

    P3M working spacing ratio = 0.2
    P3M padding factor = 3
    Reorient normals: Off

    ===

    New grid size: [256, 256, 256] with spacing = [0.4, 0.4, 0.4]
    Working domain: origin = [-29.9822 -43.3353 -36.9399] length = [60.0004 86.8617 73.8357]
    InitialCPSpacing set to 10
    Generated 504 control points
    Momentas (re)set to zero
    New grid size: [64, 128, 128] with spacing = [2, 2, 2]
    Iter 0 >> Objective = 290887 (Data Term = 290887 Regularity = 0 SparsityPrior = 0)
    stepsize = 0.130833
    stepsize = 0.0654165
    stepsize = 0.0327083
    stepsize = 0.0163541
    stepsize = 0.00817706
    stepsize = 0.00408853
    stepsize = 0.00204427
    stepsize = 0.00102213
    stepsize = 0.000511066
    stepsize = 0.000255533
    Matching took 0 hours, 21 minutes, 54 seconds
    Write output files

    • Stanley Durrleman says:

      Hello Ophelie,

      Thanks for your post! I would guess that the problem comes from the initial step size. Try to set “initial-step-multiplier” to 0.01 in the diffeo parameters XML file. You will then start the first line search in the gradient descent with a much smaller step-size. Let us know if this solves the issue.

      Stanley

  4. Shireen says:

    I have been successfully using Deformetric for deforming shapes to common template. I wonder if those shapes are associated with images (3D volume of intensities), how would I use the resulting control points and momenta to deform/resample those images to follow their shapes? I would really appreciate any hint … Thanks

    • Stanley Durrleman says:

      Hello Shireen,

      Deformetrica does not support yet image deformation on its own. What you can do is to deform the image mesh (i.e. just the list of voxels coordinates) using the estimated control points, momenta and the command ShootAndFlow, where you indicates -1 for the direction (deforming an image requires the inverse deformation). You can then resample the intensities at the new locations.

      A future release version of Deformetrica will include images as deformable objects, and the above could be done using a simple command-line.

      I hope this answers your question.
      Stanley

  5. Chris Chatham says:

    Can I use deformetrica for shape regression – i.e., to see whether some shape, expressed in varying amounts across ~20 meshes, may explain variance in a single variable with 20 observations, each corresponding to one of the meshes? I’m trying to do an individual-differences analysis on my freesurfer meshes.

    • Stanley Durrleman says:

      Hello Chris,

      What I would do in your situation is to build an atlas from your 20 FreeSurfer meshes (make sure to co-register the images rigidly and put the meshes in the native space of the images beforehand). This will build a template surface mesh, a unique set of control points and 20 sets of momentum vectors. I would then make a regression between these vectors and the co-variate.

      Does it answer your question?
      Stanley

  6. Ehsan says:

    Could you please tell me if it is possible to implement on a third surface the deformation which has been calculated between two surfaces?

    • Stanley Durrleman says:

      Yes, it is possible!

      Use the command ShootAndFlow2 (or ShootAndFlow3) using as inputs the txt files of momentum vectors and control points, which have been generated by the registration of the first two surfaces. Be careful that the third surface should be in the same region of the space as the other two.

      Stanley

  7. Ehsan says:

    Thank you so much for your complete answer and also sharing this amazing software. I would really appreciate if you could tell me a software similar to SPM or FSL for registration of hip joint images.

    • Stanley Durrleman says:

      I am sorry, but I don’t know such softwares. Future releases of Deformetrica will feature image registration, but currently only meshes are supported as input.

  8. Tanuj says:

    Hello,

    I want to project the model shape information provided in the .stl file onto some CT volumes. Is it possible through Deformetrica? I tried searching but could not get much information in this context.

    Thanks in advance!

  9. Tanuj says:

    Hello,

    I wish to project the model information (present in the .stl file) onto a number of CT volumes. Is it possible through Deformetrica? I tried searching but couldn’t get much information in this context.

    Thanks in advance!

    • Stanley Durrleman says:

      Hello,

      If you computed a deformation with Deformetrica (let’s say between two meshes from CT scans), then you could use the deformation to warp any mesh and superimpose the deformed mesh with the CT image.

      If your question is: can I register a surface mesh to a CT image?, then the short answer is no. This would require the definition of a similarity metric between a mesh and an image, which is not straightforward and has not been implemented in Deformetrica.

      I hope this answers your question,
      Best,
      Stanley

  10. Mauricio says:

    Hi!
    I just want to report a bug.
    When trying to compile Deformetrica 2.1 with itk 4.8.1, I got an cmake error message saying “include called with wrong number of arguments”. This error occurs after cmake executes the command “Find_Package(ITK)” on the CMakeList.txt main file.
    In order to provide backward compatibility and to work properly, you can change the line 16 of the main CMakeList.txt to:
    Include (${USE_ITK_FILE}) -> Include (${ITK_USE_FILE})

    • Stanley Durrleman says:

      Thanks for your feedback Mauricio! We need indeed to fix a couple of such problems related to new versions of ITK.

  11. Alex says:

    Hey, I have a compilation problem on my OSX 10.10.5, in that when trying to follow the installation instructions on this website, when I try to compile VTK 6.1.0 in the deformetrica/bin folder, I get the error:

    “clang: error: garbage collection is no longer supported
    make[2]: *** [Rendering/OpenGL/CMakeFiles/vtkRenderingOpenGL.dir/vtkCocoaRenderWindowInteractor.mm.o] Error 1
    make[1]: *** [Rendering/OpenGL/CMakeFiles/vtkRenderingOpenGL.dir/all] Error 2
    make: *** [all] Error 2”

    Any pointers? Thanks

    • Alexandre Routier says:

      Hi Alex, I may have found an issue concerning OSX 10.10.5 & VTK 6.1.0 : http://www.paraview.org/Bug/view.php?id=15196

      Could you try to compile VTK 6.2, 6.3 or 5.9 instead ?

      Best regards, Alexandre

      • Alex says:

        Thank you Alexandre,

        Using 6.3 works (6.1 also works if you remove -fobjc-gc flag from VTK_REQUIRED_OBJCXX_FLAGS, but then a lot fo warnings show up). However, I now get an error when I try to build deformetrica in:

        /Applications/deformetrica-2.1/deformetrica/bin/

        using:


        cmake -D ITK_DIR=/Applications/deformetrica-2.1/deformetrica/bin/ITKb -D VTK_DIR=/Applications/deformetrica-2.1/deformetrica/bin/VTKb ..app

        (For some reason I have to put the full paths)

        I get the error:


        CMake Error at CMakeLists.txt:16 (Include):
        include called with wrong number of arguments. include() only takes one
        file.

        VTK 6.3 is used.
        -- Found CUDA: /usr/local/cuda (found version "7.5")
        Deformetrica will be compiled with Cuda
        -- Configuring incomplete, errors occurred!

        I am using ITK 4.5.1 and CMake 3.4.0 (I could not get the command line tools for CMake 2.8.12 to work for me).

        Any more pointers? Sorry, I am quite new to all of this.

        – Alex

        • Alexandre says:

          Hi !

          Mauricio gave the answer to this problem on the forum, you need to replace line 16 by “Include (${ITK_USE_FILE})”
          (The variable has changed with the new versions of ITK)

          Moreover, you will have another issue when you will compile: on line 94 of CMakeLists.txt, replace Set (… ) by:
          Set( MY_CUDA_FLAGS -gencode arch=compute_20,code=sm_20;-gencode arch=compute_30,code=sm_30;-gencode arch=compute_35,code=sm_35)
          (The new versions of Cuda have depreciated Nvidia GPUs with compute capability before 2.0)

          Best regards, Alexandre

          • Alex says:

            Really excellent, thank you again Alexandre,

            Sorry for posting about an answered query. Also, for anyone else reading this, make sure to make the same change in the utilities/vtk/CMakeLists.txt.

            Lastly, I had a few issues when I upgraded to OSX 10.11. It seems that one get’s a CUDA related error, ‘String.h cannot be found’. To solve, I simply ran xcode-select --install, because apparently it’s uninstalled whilst upgrading to El Capitan.

            – Alex

  12. Mat says:

    Dear Deformetrica team,

    I found in the tutorial of Deformetrica you mentioned in Registration (2/1) we can scale the data before non-rigid registration. Does that mean for instance we measure a specific distance in two skull profiles and multiply the matrix of one image by the ratio of these lengths afterwards? If this understanding is true, could you please tell me what would be the characteristic length for scaling when we want to perform registration similar to Registration (2/2), for example to scale the two light blue lines?

    Best regards,
    Mat

    • Stanley Durrleman says:

      Dear Mat,

      Yes, your understanding is correct. As a rule of thumb, you may compute the typical extend of a point set (X_1,…,X_N) by computing something like \sigma = \sqrt{1/N\sum_{i=1}^N ||X_i – \overline X||^2} where \overline X is the center of mass 1/N\sum_{i=1}^N X_i.

      Then, the scaling ratio may be the ratio between the two \sigma’s (the one for the source and the one for the target object).

      Hope this helps,
      Stanley

  13. Yue Pan says:

    Dear Deformetrica team,

    Can I fix the number of control points of the deformation field? I realize with same kernel width of the deformation field, different structures need different number of control points. Can I fix it?

    Thanks,
    Yue

    • Stanley Durrleman says:

      Dear Yue,

      You can write the coordinates of your control points in a text file (therefore fixing their number and initial position). Then, you add the path to this file in the paramDiffeos.xml file as .

      Best,
      Stanley

  14. Sungmin Hong says:

    Hi,

    I am trying to run sparseMatching3 with ‘cudaexact’ kernel type option and got an error which did not occur when I tried it with same setting but with ‘exact’ kernel type.

    error: Mat::init(): requested size is not compatible with column vector layout
    Exception: Mat::init(): requested size is not compatible with column vector layout

    Would you please tell me how I can use ‘cudaexact’ option instead of ‘exact’?
    Is there any special rules on kernel-width or other options that I can use with CUDA option?
    Thank you!

    Sungmin

    • Alexandre Routier says:

      Hi !

      I have never met this issue involving “Mat::init()” in Deformetrica. Could you tell us (on the forum or by mail) what is your current configuration (Version of Linux/Mac, ITK, VTK, Cuda and any information can be useful) ?

      It would help us to understand where this error comes from.

      Thanks in advance !
      Alexandre

      • Sungmin Hong says:

        Hi, Thank you for your comment.
        My environment is,

        Linux Ubuntu 15.10
        ITK 4.8.2
        VTK 6.2
        CUDA 6.5

        But CUDA was not compatible with the latest gcc 5 version, so I used gcc and gxx 4.7 to compile all libraries.

        Hope this helps! Thank you.

        Best,
        Sungmin

        • Sungmin Hong says:

          I don’t know if this might be helpful,
          but below is the parameters and the message that I got before I ran into the error message.
          I was trying to match two shapes in vtkPolyData data type.

          Thank you.
          Sungmin

          =========================================

          Deformation Parameters:
          Kernel width = 4

          Kernel type = cudaexact

          T0 = 0 Tn = 1
          Number of time points = 10
          Initial CP spacing = 4
          Freeze CP = Off
          Initial set of CP loaded from
          Initial momenta loaded from

          Freeze Template = On

          Sparsity prior = 0

          SmoothingKernelWidthRatio = 0.5
          Optimization method: F_ISTA
          Covariance Momenta inverse loaded from
          Covariance Momenta Normalized Hyperparameter: 0.2
          Atlas Type = deterministic
          Max number of class = 1
          Inverse of the Prior for Covariance Momenta loaded from
          Atlas name:
          Max descent iterations = 100
          Max line search iterations = 25
          Step expand = 2
          Step shrink = 0.1
          Adaptive tolerance = 1e-06
          Initial step multiplier = 0.01
          Number of threads = 1
          Compute True Inverse Flow (for images) = On
          P3M working spacing ratio (for kernels of P3M type) = 0.2
          P3M padding factor (for kernels of P3M type) = 3

          ===

          Object 0:
          template file: shape_left_caudate.vtk
          Deformable object type: NonOrientedSurfaceMesh
          Data sigma = 0.1
          Data sigma prior = 1
          Data sigma normalized hyperparameter = 0.2

          Kernel type = exact
          Kernel width = 1

          Image grid downsampling = 1
          Reorient normals: On
          Anatomical Coordinate System: LPS

          ===

          Set of 168 control points defined
          Working domain only Template: origin = [ -18.4155 -7.9748 -3.6711
          ] length = [ 11.7075 31.0071 27.2475
          ]
          Working domain: origin = [ -18.5555 -21.5985 -5.4523
          ] length = [ 16.0120 44.6307 34.9609
          ]

          • Alexandre Routier says:

            Hi,

            I am a little suprised by the output of Deformetrica you are showing. Could you tell me which version are you using ?

            Thanks !

            Alexandre

          • Sungmin Hong says:

            Hi Alexandre,

            I am using development version of Deformetrica for Huntington project joint consortium with University of Iowa and New York University(former University of Utah group). The version with Armadillo. Is it possible that Armadillo might cause the problem?

            Thank you.
            Best,
            Sungmin

          • Alexandre Routier says:

            Hi !

            It is more clear then ! I think it is more related to Armadillo than CUDA (you can try with the kernel type set to Exact but I think you have the same exception).

            It would be easier to send us a mail with the commit version you are using (the command git log –pretty=format:’%h’ -n 1 should do the work), how you install Armadillo and, if possible, the dataset & script of the registration you want to run.

            Alexandre

  15. Nagesh Adluru says:

    Dear Deformetrica team,

    I am trying out some examples with sparseMatching and am getting segmentation fault with error

    “Unknown object type: NonOrientedPolyLine”

    Could you let me know if I am missing anything?
    I would appreciate your help very much on this.

    Thanks so much!
    Nagesh

    • Marta Nuñez says:

      Hi,

      I’m not sure if this would help but I recently had the same problem and could fix it by changing in DeformableObjectReader.txx this line:
      const char* ObjectType = m_ParamObject->GetDeformableObjectType().c_str();
      by:
      std::string ot = m_ParamObject->GetDeformableObjectType();
      const char* ObjectType = ot.c_str();

      And recompiling.
      For some reason the original line was returning empty line…

      Maybe you’re having the same problem.

      Marta

      • Stanley Durrleman says:

        Dear Marta,

        Thank for your reply. Yes, what you propose should do the work. This error is due to new compilers, which do not correct our errors anymore 😉 We checked the rest of the code, and this should be the only place affected. The bug will be fixed in the next release.

        Best,
        Stanley

      • Nagesh Adluru says:

        Dear Marta,

        Thanks so much for pointing to the fix. I will try this.

        Nagesh

  16. Chen Yu says:

    Hello
    I am trying to use deformetrica for creating an atlas from a sample of three knee joints. I have segmented the 3 knee data sets and stored them in .vtk format, knee_1.vtk, knee_2.vtk…. .
    Can you please let me know what should be my flow ? according to docs I need to have prototype template and Deformetrica will use that to create atlas. For my application what should I give prototype template of my knee datasets. Any suggestions would be highly appreciated.

    • Stanley Durrleman says:

      Hello,

      You’re right: the next step is to create a prototype template, that is a mesh that resembles vaguely to a knee. The only important thing is that the topology of this mesh will be preserved during optimization. You may create it using simple shapes like cylinders, spheres, etc. Alternatively, you may start with one of your sample shape, and smooth it *a lot* till there are no more details that are specific to the chosen sample.
      Best,
      Stanley

  17. mahesh says:

    i am not able to execute deformatrica. getting a error in a .txx file like

    Error 12 error C2350: ‘Landmark::ComputeMatch’ is not a static member d:\deformetrica-2.1\deformetrica\src\algo\deformable_objects\Landmark.txx 190 1 sparseAtlas2
    Error 17 error C4430: missing type specifier – int assumed. Note: C++ does not support default-int D:\deformetrica-2.1\deformetrica\src\algo\energy_minimization\SparseDiffeoMatcher.h 240 1 ShootAndFlow2

    • Stanley Durrleman says:

      Hi,

      Could you please send us the command line that you used, and all what was written on the screen after that?

      Thanks,
      Stanley

  18. Yue Pan says:

    hi,

    I use the software to register the centerline of the vessels in the lung and I wonder if I can get the deformation field based on the CP.txt and Mom.txt files? I want to use the deformation field to deform the whole lung.

    Thanks,
    Yue

    • Stanley Durrleman says:

      Hi Yue,

      The app “ShootAndFlow” allows you to compute the deformation field. It takes the files MOM.txt and CP.txt as inputs.

      If you want to deform the image of the lung, compute then the inverse deformation field (using the flag -1) at each voxel position in the image domain (in real world coordinates). You would need then to interpolate the image intensities at the new voxel positions.

      If you want to deform a mesh of the lung, compute then the deformation field (using the flag 1) at each vertex of the mesh. The output is the deformed mesh, with the new vertex positions.

      Stanley

  19. Emanuele Olivetti says:

    Dear Deformetrica Team, I am trying to use deformetrica to register sets of fibers. I observe the following problem with the ‘cudaexact’ kernel type: sparseMatching3 returns just zeros in Mom_final.txt and the optimization proceeds as follows:
    —-
    Working domain: origin = [26.8694 30.5704 7.84279] length = [127.07 162.807 130.544]
    InitialCPSpacing set to 30
    Generated 150 control points
    Momentas (re)set to zero
    Iter 0 >> Objective = 0 (Data Term = 0 Regularity = 0 SparsityPrior = 0)
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    Matching took 0 hours, 0 minutes, 2 seconds
    —-
    Differently, with kernel type “exact” I obtain actual deformations, i.e. the values in Mom_final.txt are non-zeros. Here is an example of log:
    —-
    Working domain: origin = [26.8694 30.5704 7.84279] length = [127.07 162.807 130.544]
    InitialCPSpacing set to 30
    Generated 150 control points
    Momentas (re)set to zero
    Iter 0 >> Objective = 44952.4 (Data Term = 44952.4 Regularity = 0 SparsityPrior = 0)
    stepsize = 0.0102608
    stepsize = 0.00513041
    stepsize = 0.00256521
    Iter 1 >> Objective = 31715.4 (Data Term = 31642.8 Regularity = 72.5864 SparsityPrior = 0)
    150 active control points
    stepsize = 0.00256521
    Iter 2 >> Objective = 27514 (Data Term = 27352.5 Regularity = 161.465 SparsityPrior = 0)
    150 active control points
    stepsize = 0.00256521
    Iter 3 >> Objective = 24955.3 (Data Term = 24706.3 Regularity = 249.034 SparsityPrior = 0)
    150 active control points
    stepsize = 0.00256521
    […]
    —-
    Could you please help me to solve this issue? I need to understand whether CUDA can significantly speed-up the computation or not with respect to using the CPU, because I need to increase the number of control points.
    I am using Ubuntu 16.04, ITK-4.10, VTK-7.0, CUDA v7.5. I compiled ITK, VTK and deformetrica following the instructions on your website and manually modified CMakeLists.txt and DeformableObjectReader.txx following the instructions in this forum (otherwise there are compilation/execution errors). Additionally, I also tested on Ubuntu 14.04, ITK-4.5, VTK-6.1, CUDA v5.5. Again, I observed the issue described above, i.e. ‘cudaexact’ returns just zeros as momenta while ‘exact’ (correctly) generates nonzeros values. Note: in both cases, the CUDA and the GPUs of the respective computers work correctly in all other applications.

    • Alexandre Routier says:

      Hello Emanuele,

      Could you tell me the name of the GPU you used with Deformetrica ?
      Also, could me tell me if the examples worked with Cuda ?

      Thanks in advance,
      Alexandre

      • Emanuele Olivetti says:

        Thank you for the quick reply. I’m using NVIDIA GeForce GTX560 and doing some tests on a smaller NVIDIA NVS 310.
        The simple example in tutorials/Registration1 does not work with the ‘cudaexact’ kernel type and returns:

        Exception: In CUDAExactKernel::Convolve(X) – Invalid number of rows of beta !

        Best,
        Emanuele

    • Pietro says:

      Dear Emanuele,

      First of all, thank you very much for using Deformetrica! The error is definitely related to CUDA. Let’s try to find the cause:

      1- When you build ‘cmake’, do you see the output ‘– Found CUDA: path_to_cuda ; Deformetrica will be compiled with Cuda’ ?

      2- What’s your graphic card ? Do you know its Compute Capability ? You can find it here -> https://developer.nvidia.com/cuda-gpus

      3- Have you tried to run the example in the folder ‘tests/surface_matching’ using CUDA ? You need to set the parameter ‘kernel-type’ to ‘cudaexact’ both in ‘paramDiffeos.xml’ and in ‘paramSurface.xml’. Then run ‘../../deformetrica/bin/sparseMatching3 paramDiffeos.xml paramSurface.xml sourceSurfaceMesh.vtk targetSurfaceMesh.vtk’. Is the initial ‘Data Term’ equal to 0 ?

      • Emanuele Olivetti says:

        Hi Pietro, thank you for the quick reply.
        1- Yes, I compiled Deformetrica with CUDA. The message you mention appeared on the screen when cmake was executed.
        2- I have access to an NVIDIA GeForce GTX 560 and a smaller NVIDIA QUADRO NVS 310. According to the NVIDIA website both have compute capability 2.1.
        3- I’ve just tried to run the surface_matching example, as you describe, and the initial Data Term is equal to 0. At the moment I could use just the QUADRO NVS 310. Tomorrow I will try with the GTX 560.

        • Emanuele Olivetti says:

          I can confirm that the Data Term of the surface_matching example is equal to 0 even with the NVIDIA GTX 560.
          Best,
          Emanuele

          • Alexandre Routier says:

            Hi,

            Can you send us an email (deformetrica [dot] team [at] gmail [dot] com) with your CMakeLists.txt ? I will send a draft code to compare the CPU and GPU code of Kernel evaluation. It may help what’s going on.

            Alexandre

          • Emanuele Olivetti says:

            Hi Alexandre and Pietro,

            Some days ago I sent the requested files (CMakeLists.txt) to the email address of the Deformetrica Team, that you indicated. Could you please acknowledge that you received the files?
            Best,
            Emanuele

          • Alexandre Routier says:

            Hello,

            It turns out to be a problem with the installation of Cuda. If possible, use the automated installation of Cuda on Nvidia website : https://developer.nvidia.com/cuda-downloads 🙂

            Alexandre

          • Emanuele Olivetti says:

            Hi again,

            A few days ago I’ve sent a message to the email address of the Deformetrica Team, following your gentle request, and as a follow-up to the issues in this thread. Could you please acknowledge that you received my message?
            Best,
            Emanuele

  20. Pietro says:

    Hi Emanuele,

    Yes, we received your email.
    I have just replied.
    Best regards,
    Pietro

  21. Amanda Pan says:

    Dear Deformetrica team:

    I want to compute the Jacobian image from the deformation field. I know I can use the CP.txt and Mom.txt to deform the shape, but is there a way to get the deformation filed and store it as an image?
    Thanks,

    Amanda

    • Stanley Durrleman says:

      Dear Amanda,

      There is no direct way to do it currently. What you could do is to store the coordinates of the voxels in a vtk files, and deform these points using ShootAndFlow. Take the output and transform it back to an image. Hope this helps.

      Best,
      Stanley

  22. Nicolas Cedilnik says:

    Just in case anybody needs to compile under Fedora 24, here’s what I had to do:

    in CMakeLists.txt:

    add the line:
    set(CMAKE_CXX_FLAGS -fpermissive)

    (following changes were mentioned by other in the forum here but I guess writing it all in the same comment will make it easier to find for others)

    change USE_ITK_FILE to ITK_USE_FILE

    in DeformableObjectReader.txx:

    change:
    const char* ObjectType = m_ParamObject>GetDeformableObjectType().c_str();

    to:
    std::string ot = m_ParamObject->GetDeformableObjectType();
    const char* ObjectType = ot.c_str();

    Do you have a public git repo? Reading the forum here makes me think you would have interesting pull requests…

    • Stanley Durrleman says:

      Dear Nicolas,
      Thank you for your post.
      We are currently working on a new major release of Deformetrica, which will come with an open Git repo (and much more!)
      Stay tuned 😉
      Best,
      Stanley

  23. Shusil says:

    Hi Deformetrica Team,

    I am having problems with ‘cudaexact’ kernel type when running the registration algorithm. It runs fine with the ‘exact’ kernel type. As suggested in earlier post, I installed Cuda from the NVIDIA site: https://developer.nvidia.com/cuda-downloads

    I am on following platform:
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 16.04.1 LTS
    Release: 16.04
    Codename: xenial

    Here’s the output I get when I run the surface_matching test:

    Deformetrica 2.1
    (Computations are in double precision)

    Sparse diffeomorphic matching
    ===
    Number of objects detected: 1

    ===

    Deformations Parameters:
    Kernel width = 1.5

    Kernel type = cudaexact
    P3M working spacing ratio = 0.2
    P3M padding factor = 3

    Number of time points = 20
    Initial CP spacing = 0.3
    Freeze CP = Off
    Initial set of CP loaded from
    Initial momenta loaded from

    Sparsity prior = 0

    SmoothingKernelWidthRatio = 1
    Optimization method: F_ISTA
    Max descent iterations = 200
    Max line search iterations = 20
    Step expand = 2
    Step shrink = 0.5
    Adaptive tolerance = 0.0001
    Initial step multiplier = 0.001
    Number of threads = 1

    ===

    Object 0:
    Source file: sourceSurfaceMesh.vtk
    Target file: targetSurfaceMesh.vtk
    Deformable object type: OrientedSurfaceMesh
    Data sigma = 0.01

    Kernel type = cudaexact
    Kernel width = 2.5

    P3M working spacing ratio = 0.2
    P3M padding factor = 3
    Reorient normals: Off

    ===

    Working domain: origin = [0.333333 0.333333 0] length = [0.333333 0.333333 0.666667]
    Generated 12 control points
    Momentas (re)set to zero
    Iter 0 >> Objective = 0 (Data Term = 0 Regularity = 0 SparsityPrior = 0)
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    stepsize = 0
    Matching took 0 hours, 0 minutes, 0 seconds
    Write output files

    nvcc –version:
    nvcc: NVIDIA (R) Cuda compiler driver
    Copyright (c) 2005-2016 NVIDIA Corporation
    Built on Sun_Sep__4_22:14:01_CDT_2016
    Cuda compilation tools, release 8.0, V8.0.44

    nvidia-smi:

    +—————————————————————————–+
    | NVIDIA-SMI 375.39 Driver Version: 375.39 |
    |——————————-+———————-+———————-+
    | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
    | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
    |===============================+======================+======================|
    | 0 GeForce GTX TIT… Off | 0000:02:00.0 On | N/A |
    | 22% 32C P8 14W / 250W | 159MiB / 12205MiB | 0% Default |
    +——————————-+———————-+———————-+

    +—————————————————————————–+
    | Processes: GPU Memory |
    | GPU PID Type Process name Usage |
    |=============================================================================|
    | 0 2790 G /usr/lib/xorg/Xorg 47MiB |
    | 0 4522 G /usr/lib/xorg/Xorg 48MiB |
    +—————————————————————————–+

    deviceQuery:

    CUDA Device Query (Runtime API) version (CUDART static linking)

    Detected 1 CUDA Capable device(s)

    Device 0: “GeForce GTX TITAN X”
    CUDA Driver Version / Runtime Version 8.0 / 8.0
    CUDA Capability Major/Minor version number: 5.2
    Total amount of global memory: 12206 MBytes (12798787584 bytes)
    (24) Multiprocessors, (128) CUDA Cores/MP: 3072 CUDA Cores
    GPU Max Clock rate: 1076 MHz (1.08 GHz)
    Memory Clock rate: 3505 Mhz
    Memory Bus Width: 384-bit
    L2 Cache Size: 3145728 bytes
    Maximum Texture Dimension Size (x,y,z) 1D=(65536), 2D=(65536, 65536), 3D=(4096, 4096, 4096)
    Maximum Layered 1D Texture Size, (num) layers 1D=(16384), 2048 layers
    Maximum Layered 2D Texture Size, (num) layers 2D=(16384, 16384), 2048 layers
    Total amount of constant memory: 65536 bytes
    Total amount of shared memory per block: 49152 bytes
    Total number of registers available per block: 65536
    Warp size: 32
    Maximum number of threads per multiprocessor: 2048
    Maximum number of threads per block: 1024
    Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
    Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)
    Maximum memory pitch: 2147483647 bytes
    Texture alignment: 512 bytes
    Concurrent copy and kernel execution: Yes with 2 copy engine(s)
    Run time limit on kernels: Yes
    Integrated GPU sharing Host Memory: No
    Support host page-locked memory mapping: Yes
    Alignment requirement for Surfaces: Yes
    Device has ECC support: Disabled
    Device supports Unified Addressing (UVA): Yes
    Device PCI Domain ID / Bus ID / location ID: 0 / 2 / 0
    Compute Mode:

    deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 8.0, CUDA Runtime Version = 8.0, NumDevs = 1, Device0 = GeForce GTX TITAN X
    Result = PASS

    I am trying to build an atlas from large number of patients and was hoping the GPU acceleration will help reduce the computation time.
    I would really appreciate your feedback. Thank you so much!

Leave a Reply

Your email address will not be published. Required fields are marked *