[Insight-users] Input image not availabe

kavec at messi.uku.fi kavec at messi.uku.fi
Thu Nov 24 06:59:36 EST 2005


Hi,

I am working on an new ImageToImageFilter class, which needs a float as an
input. This can be either set by a user or calculated automatically from an
input image histogram. So I would like the class interface for this
functionality look as follows:

myFilter->SetMyFloat( myfloat ); // Set manually
myFilter->SetMyFloat();   //Calculated from histogram

myFilter->Update();


Setting myFloat works fine, but automatic calculation does not. Here is how I
define SetMyFloat():

....void SetMyFloat( ) {
  Superclass::GenerateInputRequestedRegion();

  typename Superclass::InputImagePointer  input = const_cast< TInputImage *>(
                                                  this->GetInput() );

  if ( !input ) {
     std::cout << "No input available exiting." << std::endl;
     return;
  }

//.....calculation of the myFloat which works
}


The execution stops as if the input is not available. I am affraid it may have
something to do with pipeline execution, but I can not figure out, how to fix
it.


Thanks for suggestion in advance.

Martin


More information about the Insight-users mailing list