[Insight-users] FEM Deformable Registration

Luis Ibanez luis.ibanez at kitware.com
Fri, 06 Feb 2004 22:13:18 -0500


Hi Hari,


1)  There is not much documentation available at
     this point concerning the FEM configuration
     file.

     It may help you to get familiar with the code
     that actually parses the file, so you can get a
     feeling of the effects that the file parameters
     have on the FEM registration process.

     You will find this code at

          Insight/Code/Algorithms/
             itkFEMRegistrationFilter.txx


     in the method

           ReadConfigurationFile();

-----


2) It is likely that your program is trying to
    allocate too much memory. There is a lot of
    temporary memory that gets allocated by this
    filter. In particular for the computation of
    the image metric derivatives.

    Are you doing this on Windows or Linux ?

    You may want to track the memory reported by
    the operating system while you are running this
    process. In MS-Windows you can do this with the
    Task Manager, in Unix you can do this with the
    'top' command.


----

3) As a coarse estimation, I would expect this
    filter to allocate about 10 times the memory
    size of the image.





Regards,



    Luis



-------------------
Hari sundar wrote:

> Hi Luis,
> 
> Yes that was the problem. I figured that out eventually. Is there more
> information available on the config. file used by the fem registration
> filter ?
> 
> Also, I am running into problems with running both the deformable
> registration examples on 3D datasets.
> 
> For both cases, the program exits with "Abort".
> 
> I caught the exception and it's a std. st9bad_alloc exception. Although
> my datasets are quite big, still I think my machine has enought RAM to
> handle it.
> 
> The only question is how do I estimate the memory footprint of a
> pipeline that I set up ? like for example ... if I have a pipeline like
> ..
> 
> reader<ushort,3> => Caster<ushort, float, 3> => filter => warper =>
> Caster<float, ushort, 3> => writer<ushort, 3> 
> 
> and am passing some file as input to it ... how much can I expect the
> footprint to be ...
> 
> thanks a lot ...
> 
> -Hari
> 
> On Thu, 2004-02-05 at 16:42, Luis Ibanez wrote:
> 
>>Hi  Hari,
>>
>>Many of the entries on the configuration file
>>of the FEM Deformable Registration filter are
>>dimension dependent.
>>
>>That is, for 2D image they expect two values,
>>while for 3D images they expect three values.
>>
>>For example:
>>
>>      1 1    	% Scaling at lowest level of pyramid
>>
>>
>>
>>Did you make sure to provide the appropriate
>>number of paramters in those entries  ?
>>
>>Chances are that you are still providing two
>>values in one of them and the parser is getting
>>out of synch while reading the file.
>>
>>Please post your FEM configuration file
>>to the list.
>>
>>
>>Thanks
>>
>>
>>
>>    Luis
>>
>>
>>
>>----------------------
>>Hari sundar wrote:
>>
>>
>>>Hi,
>>>
>>>This is a really wierd problem that I am having. I modified the FEM
>>>deformable registration example to handle 3D datasets. It compiles fine,
>>>but does not read the config file properly. The config file is just
>>>modified from the orig. config file and I have tried keeping everything
>>>similar.
>>>
>>>This is what happens when I run the program.
>>>As you can see, even the E and rho values are not read correctly. What
>>>could be the problem here ?
>>>
>>>-Hari
>>>
>>>-------------------------
>>>Reading config.txt
>>>Reading config file...config.txt
>>>Example configured. E 0 rho 0
>>>Moving File
>>>Fixed File
>>> reading moving
>>> reading fixed
>>>Exception caught during reference file reading
>>>                                                                                
>>>itk::ImageFileReaderException (0x81458c8)
>>>Location: "Unknown"
>>>File: /usr/local/src/InsightToolkit-1.4.0/Code/IO/itkImageFileReader.txx
>>>Line: 91
>>>Description: FileName must be specified
>>>--------------------------
>>>
>>>The relevant code ...
>>>
>>>-----------------
>>>{
>>>    ElementType::LoadImplementationFunctionPointer fp = 
>>>&itk::fem::ImageMetricLoadImplementation<ImageLoadType>::ImplementImageMetricLoad;
>>>    DispatcherType::RegisterVisitor((ImageLoadType*)0,fp);
>>>  }
>>>  
>>>  {
>>>    ElementType2::LoadImplementationFunctionPointer fp =
>>>&itk::fem::ImageMetricLoadImplementation<ImageLoadType>::ImplementImageMetricLoad;
>>>    DispatcherType2::RegisterVisitor((ImageLoadType*)0,fp);
>>>  }
>>>
>>>  RegistrationType::Pointer X = RegistrationType::New();
>>>
>>>  X->SetConfigFileName(paramname);
>>>  std::cout << "Reading " << X->GetConfigFileName() << std::endl;
>>>  if ( !X->ReadConfigFile( (X->GetConfigFileName()).c_str() ) )  { 
>>>    return -1; 
>>>  }
>>>  
>>>  std::cout << "Moving File " << X->GetMovingFile() << std::endl;  
>>>  std::cout << "Fixed File " << X->GetFixedFile() << std::endl;
>>>
>>>
>>>  // Read the image files  
>>>  FileSourceType::Pointer movingfilter = FileSourceType::New();
>>>  movingfilter->SetFileName( (X->GetMovingFile()).c_str() );
>>>  FileSourceType::Pointer fixedfilter = FileSourceType::New();
>>>  fixedfilter->SetFileName( (X->GetFixedFile()).c_str() );
>>>----------------------------
>>>
>>>
>>>_______________________________________________
>>>Insight-users mailing list
>>>Insight-users at itk.org
>>>http://www.itk.org/mailman/listinfo/insight-users
>>>
>>
>>
>>
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users at itk.org
>>http://www.itk.org/mailman/listinfo/insight-users
> 
> 
>