[Insight-users] how to put more images to an filter?
Guorong Wu
grwu at sjtu.edu.cn
Mon Jul 26 03:08:47 EDT 2004
hello all:
I am implementing a non-rigid registration algorithm which is derived from PEDDeformalbeRegistraionFilter and PDEDeformableRegistrationFunction. The difference is that it will use segmented images of both fixed image and moving image. So My class is defined as follows:
SegmentationBasedRegistraionFilter<TFixedImage, TMovingImage, TSegFixedImage, TSegMovingImage, TDeformationField>
::PDEDeformableRegistrationFilter<TFixedImage,TMovingImage,TDeformationField>
SegmentationBasedRegistrationFunction<TFixedImage, TMovingImage, TSegFixedImage, TSegMovingImage, TDeformableField>
::PDEDeformableRegistrationFunction<TFixedImage, TMovingImage, TDeformableField>
In order to use the value of SegFixeImage and SegMovingImage which are pre segmented images classified into several types(WM,GM,CFS), I refer to the source code of PDEDeformableRegistration class. I found PDEDeformableRegistration class is derived from DenseFiniteDifferenceImageFilter which doesn't have Set/GetFixedImage and Set/GetMovingImage methods and PEDDeformableReigstration implement these function in PDEDeformableRegistrationFilter.h/.txx and PDEDeformableRegistrationFunction.h/txx. So I think maybe I can add SetGetSegFixedIimage and Set/GetMovingImage methods the same way. The main implementation is as follows:
/*
*Set the SegFixedImage
*/
template <class TFixedImage, class TMovingImage, class TSegFixedImage, class TSegMovingImage,class TDeformationField>
void
SegmentationBasedRegistrationFilter<TFixedImage,TMovingImage,TSegFixedImage,TSegMovingImage,TDeformationField>
::SetSegFixedImage(const SegFixedImageType * ptr)
{
this->ProcessObject::SetNthInput(3, const_cast< SegFixedImageType * >(ptr));
}
/*
*Set the SegMovingImage
*/
template <class TFixedImage, class TMovingImage, class TSegFixedImage, class TSegMovingImage,class TDeformationField>
void
SegmentationBasedRegistrationFilter<TFixedImage,TMovingImage,TSegFixedImage,TSegMovingImage,TDeformationField>
::SetSegMovingImage(const SegMovingImageType * ptr)
{
this->ProcessObject::SetNthInput(4, const_cast<SegMovingImageType *>(ptr));
}
I replace the DemonsRegistaionFilte in DeformableRegistraion2.cxx with this new filter and I can Build this example with no errors. But when I run it, some unkown exception occurs. I step into the program finding that the exception occur at the line filter->Update(). The problem is I even don't know where is wrong and whether my modification is right. Would you like to give me some suggestions? Thanks in advance.
Guorong Wu
grwu at sjtu.edu.cn
2004-07-26
=============================================================
Guorong Wu
The Department of Computer Science and Technology
Shanghai Jiao Tong University
1954 Huashan RD
Shanghai China
200030
Tel: +86 21 3226 1236 , 6293 2089
=============================================================
-------------- next part --------------
A non-text attachment was scrubbed...
Name: itkSegmentationBasedRegistrationFilter.rar
Type: application/octet-stream
Size: 12443 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/insight-users/attachments/20040726/eaa06dd3/itkSegmentationBasedRegistrationFilter-0001.obj
More information about the Insight-users
mailing list