Hi Alex,
The blocks of code you sent me look fine to me. You say that it works
if you use the same image pointer as fixed and moving input images for the
registration filter. You could try the following:
1. Copy the first image file and rename both to image00.vtk and
image01.vtk. Load both images as a single 3D+T. Execute the filter using
time step 0 and time step 1. This should work because when you use the same
image pointer, the registration is working.
2. Try to use another image. Maybe the problem is related to the image
you are using.
If you could send me the source code of the processor and the image you
are using, I can also take a look.
You can also take a look at the SandBox Plugin resample processor
(SandboxPluginResampleProcessor.cxx). It takes an input ITK image, an input
point and resamples the image.
Best regards,
Xavi
2012/8/19 Zhijun Zhang <[email protected]>
> hi Xavier:
>
> I am recently try to make some code to register some image sequence.
> However I got some trouble. I want to make a simple code to estimate the
> pairwised deformation between an image sequences.
>
>
> First I put in my plugin processor() function some code to test reading
> the sequence:
>
> int numOfTimeSteps = GetInputDataEntity(0)->GetNumberOfTimeSteps();
> for ( int i = 0 ; i < numOfTimeSteps ; i++ )
> {
> //Core::vtkImageDataPtr inputImage;
> ImageType::Pointer itkInputImage1;
> GetProcessingData( 0, itkInputImage1, i );
> std::cout<< "frame no. " << i <<std::endl;
> }
>
> this seems works fine. I opened a sequence of 3 image framess and when it
> runs
> 3 lines are printed in the console.
>
> Then I would like to use the first and second frames as the source and
> target image to register them:
> The two image frames are read into the program by using:
> ImageType::Pointer itkInputImage1;
> ImageType::Pointer itkInputImage2;
> GetProcessingData(INPUT_0, itkInputImage1,0);
> GetProcessingData(INPUT_0, itkInputImage2,1);
>
>
> and then I copied and paste some code from an registration example from
> the itk source and use
> itkInputImage1 and itkInputImage2 as the source and target image.
>
> However, when it runs, there is an error (see the image attached, the
> debugger stops at
> line registration->StartRegistration(); ).
> I do not know whether my way to access the first two frames is valid
> or if there is other problem in my program.
>
> The registration code should be ok, since if I open one image and
> pass the image pointer to both the source and target image in the
> registration code, registration works.
>
> I have been stuck to this problem for a while. Hope you can
> give me some idea. Thank you very much.
>
> regards,
> Alex
>
>
> 2012/6/11 Xavier Planes <[email protected]>
>
>> Hi Alex,
>>
>> These days we are working on several project deliverables and on a
>> new release of GIMIAS-1.5. You can find more details here:
>> http://www.gimias.org/download/gimias-15
>>
>> Regarding your questions:
>> 1. Read image properties:
>>
>> a. If using a Processor:
>> The best way to know the pixel type and the dimension is
>> to
>> retrieve the vtk image from a DataEntity:
>>
>> Core::vtkImageDataPtr inputImage;
>> GetProcessingData( 0, inputImage );
>>
>> inputImage->GetDimensions()
>> inputImage->GetSpacing();
>> inputImage->GetOrigin();
>> inputImage->GetScalarTypeAsString();
>>
>> b. If using a CommandLinePlugin: You can use ITK directly.
>> You can see an example in GaussianBlurImageFilter.cxx
>>
>> 2. Retrieve 3D+T data:
>>
>> a. For a Processor you can read the documentation:
>>
>>
>> https://sourceforge.net/apps/mediawiki/gimias/index.php?title=Extensible_Exe
>> cution_Component#3D.2BT_processing<https://sourceforge.net/apps/mediawiki/gimias/index.php?title=Extensible_Execution_Component#3D.2BT_processing>
>>
>> b. For a CommandLinePlugin:
>>
>>
>> https://sourceforge.net/apps/mediawiki/gimias/index.php?title=HowToDevelopAC
>> ommandLinePlugin#3D_.2B_T_processing<https://sourceforge.net/apps/mediawiki/gimias/index.php?title=HowToDevelopACommandLinePlugin#3D_.2B_T_processing>
>>
>> 3. Elastix: I've been in an introductory presentation about
>> Elastix
>> some weeks ago and it was very interesting. However, I've never used it
>> :(.
>> It will be really great to integrate this library in GIMIAS. If you are
>> integrating the source code of Elastix, I think you will not have any
>> problem to use the same ITK version used in GIMIAS. If you are using the
>> precompiled library, it could be more difficult.
>>
>> To integrate the precompiled library, it's very easy. You can
>> take a
>> look at this tutorial:
>>
>>
>> https://sourceforge.net/apps/mediawiki/gimias/index.php?title=HowToCreateYou
>> rThirdParty
>>
>> For the integration of Elastix, I'm thinking that it could be
>> easier
>> to use a command line plugin, instead of a GIMIAS native plugin because a
>> command line plugin uses ITK directly.
>>
>> Best regards,
>> Xavi
>>
>> From: Zhijun Zhang [mailto:[email protected]]
>> Sent: lunes, 11 de junio de 2012 0:24
>> To: Xavier Planes; [email protected]
>> Subject: Re: [Gimias-developers] help about the plugin
>>
>> hi Xavier:
>>
>> How are you these days?
>> I have read some of the tutorials and now I can write a little code
>> to
>> have a two image registration plugin.
>> Now I would like to write an image sequence registration tool. I would
>> like to have the following problems:
>>
>> 1. for single image, if I open it in the GIMIAS menu file->open data, It
>> shows in the data tree area,
>> then how do I know the image pixel type, dimension? because I need to
>> define
>> an itk registration method with
>> the template parameter of the pixel type and dimension.
>>
>> 2. If I open a 3D image sequences (lets say, ten analyze image or vtk
>> image), how do I know the number of frames in this sequence and how I can
>> get the pointer of each image frame in my processor functions?
>>
>> 3. I would like to call image registration functions in another library(
>> like elastix ) in my plugin code, is there easy ways to add this
>> library? is
>> it necessary that the itk library that gimias based on and the itk
>> elastix
>> based on are the same version?
>>
>> thank you very much.
>>
>> regards,
>> Alex
>>
>>
>>
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Gimias-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gimias-developers