[Insight-users] how to put more images to an filter?
Miller, James V (Research)
millerjv at crd.ge.com
Tue Jul 27 10:42:00 EDT 2004
Your changes look to be fine. Can you put your call to Update() on your
filter within a try/catch block and
print out the exception message?
try
{
filter->Update();
}
catch( itk::ExceptionObject & err )
{
std::cout << "ExceptionObject caught !" << std::endl;
std::cout << err << std::endl;
return -1;
}
-----Original Message-----
From: Guorong Wu [mailto:grwu at sjtu.edu.cn]
Sent: Sunday, July 25, 2004 1:01 PM
To: ITK Mailling List
Subject: [Insight-users] how to put more images to an filter?
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
=============================================================
More information about the Insight-users
mailing list