[Insight-users] Trouble with getting the output ofFastMarchingImageFilter

Iván Macía imacia at vicomtech.es
Mon Dec 5 09:39:14 EST 2005


Hi,

Possibly the problem is that you are creating a new image when you don't
need to and possibly the regions are not correctly set. Try if this works :

ConstIteratorType constIterator3( fastMarching->GetOutput(),
fastMarching->GetOutput()->GetRequestedRegion() );

float timedata[imageWidth*imageHeight];
InternalImageType::PixelType pixel;
int i;
for(constIterator3.GoToBegin(),i=0;!constIterator3.IsAtEnd();
++constIterator3,i++)
{
  pixel = constIterator3.Get();
  timedata[i] = (float)pixel; 
}


Another approach for copying the output using itk images is the following :

InternalImageType::Pointer image = ImageType::New();      
 
image->SetRegions( fastMarching->GetOutput()->GetRequestedRegion());
image->Allocate();

ConstIteratorType inputIt( reader->GetOutput(),
fastMarching->GetOutput()->GetRequestedRegion() );
IteratorType     outputIt( image ,
fastMarching->GetOutput()->GetRequestedRegion() );

for ( inputIt.GoToBegin(), outputIt.GoToBegin(); !inputIt.IsAtEnd();
++inputIt, ++outputIt )
{
  outputIt.Set( inputIt.Get() );
}


Hope that helps

Iván


-----Mensaje original-----
De: insight-users-bounces+imacia=vicomtech.es at itk.org
[mailto:insight-users-bounces+imacia=vicomtech.es at itk.org] En nombre de ÇØ°²
Enviado el: lunes, 05 de diciembre de 2005 8:48
Para: ibanez luis
CC: insight-users
Asunto: [Insight-users] Trouble with getting the output
ofFastMarchingImageFilter


hi,luis and  itk users:

    when working with the FastMarchingImageFilter, i try to get the output
time crossing image. i write the simple codes as below "
    InternalImageType::Pointer internalImage3 = InternalImageType::New();
	internalImage3 = fastMarching->GetOutput();
	ConstIteratorType
constIterator3(internalImage3,internalImage3->GetRequestedRegion());

	float timedata[imageWidth*imageHeight];
    InternalImageType::PixelType pixel;
    int i;
	for(constIterator3.GoToBegin(),i=0;!constIterator3.IsAtEnd();
++constIterator3,i++)
	{
		pixel = constIterator3.Get();
		timedata[i] = (float)pixel; 
	}
"
     The whole image processing pipeline has been update successfully
before, and the output binary images suggest the filters work well. but when
come to these codes, the pixel variable simply get noting.  
     Any help will be appreciated.     Thank you for your help and best
regards!
 




	


-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.10/190 - Release Date: 01/12/2005
 
    

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.10/190 - Release Date: 01/12/2005
 



More information about the Insight-users mailing list