[Insight-developers] IRIX64-6.5-CC-n32-Continuous errors and CastImageFilter

Brian avants at grasp . cis . upenn . edu
Fri, 2 Aug 2002 14:44:05 -0400 (EDT)


Hello fellow developers and especially those whose C++/itk expertise is
beyond mine,

I'm working on generalizing the FEM registration example to
multi-resolution as well as arbitrary dimension.  It's coming along pretty
well, but two things have come up.

First, we are getting some errors on the IRIX64-6.5-CC-n32-Continuous
build that do not show up on the same machine's nightly builds.  Bill L.
revealed that this is because the examples are not built nightly on that
machine.  The compiler complains about the FEMGenerateMesh.cxx file - the
class is instantiated in the FEM landmark example.  The main error seems
to be this one :

 Explicit specialization of function

"itk::fem::GenerateMesh<itk::fem::Element2DC0LinearQuadrilateral>::Re
          ctangular" must precede its first use.
  ::Rectangular(ElementType::ConstPointer e0, Solver& S, VectorType& orig,
VectorType& size, VectorType& Nel)
    ^
which gives birth to a bunch of other problems.  I'm not sure what this
means and we don't have these types of machines here.

Second Issue: I'm using the RecursiveMultiResolutionPyramid which requires
input images to be of type Real.  So I'm casting some unsigned chars to
floats before input (in Examples/FEM/FEMImageResLMex.cxx).  The problem
was that the casted images were wrong after the first application of the
CastImageFilter, uless i "fixed" things by declaring

  CasterType2::Pointer Rcaster2 = CasterType2::New();
  CasterType2::Pointer Tcaster2 = CasterType2::New();

inside the multi-resolution loop.  I expected to be able to make these
declarations only once, before the loop, and have them work fine.  I use
the casters in the following way:

    Rcaster2->SetInput(pyramidR->GetOutput(i));
    Rcaster2->Update();
    m_Load->SetReferenceImage(Rcaster2->GetOutput());

to cast from float back to unsigned char.  Is making the New() call inside
the loop the correct usage?

Any help on these issues is much appreciated.

Enjoy the weekend,

Brian