[Insight-developers] Problem with BinaryMask3DMeshSource

Miller, James V (Research) millerjv at crd.ge.com
Tue Mar 8 09:27:18 EST 2005


Gunn Marie, 

For some reasong the BinaryMask3DMeshSource only accepts an input image
of the type Image<unsigned short, 3>.

This is hardwired in the class definition which is only templated over the 
Mesh type and prescribes the input image type:

template <class TOutputMesh>
class ITK_EXPORT BinaryMask3DMeshSource : public ImageToMeshFilter<Image<unsigned short, 3>,TOutputMesh>
{
}

You can use a CastImageFilter perhaps in conjunction with a
ShiftScaleImageFilter or RescaleIntensityImageFilter to convert the input
image to unsigned short with an appropriate dynamic range.

I am not sure I see any reason that this filter only accepts unsigned short
images.  It could be rewritten to be templated over the input image type.  
However, it would be difficult to do and retain backward compatibility.  
Perhaps we should have a new filter BinaryMask3DMeshFilter that could 
address this.  If you'd like, you can enter a feature request in the 
Bug Tracker.

Jim


-----Original Message-----
From: insight-developers-bounces at itk.org
[mailto:insight-developers-bounces at itk.org]On Behalf Of Gunn Marie
Navestad
Sent: Tuesday, March 08, 2005 5:46 AM
To: insight-developers at itk.org
Subject: [Insight-developers] Problem with BinaryMask3DMeshSource


I have a problem when I'm trying to use the BinaryMask3DMeshSource-class
in itk 2.0. I have defined a BinaryMask3DMeshSource-filter and I would
like to put a float-image as input to this filter. The problem is that the
"SetInput"-method seems to demand an input parameter of type itk:Mesh. The
following error message appears when I try to compile my code:

"error C2664: 'itk::BinaryMask3DMeshSource<TOutputMesh>::SetInput' :
cannot convert parameter 1 from
'itk::Image<TPixel,VImageDimension>::Pointer' to 'const
itk::BinaryMask3DMeshSource<TOutputMesh>::InputImageType *'
        with
        [
            TOutputMesh=MeshType
        ]
        and
        [
            TPixel=float,
            VImageDimension=3
        ]
        and
        [
            TOutputMesh=MeshType
        ]
"

Here is my code:

	typedef itk::Mesh<float> MeshType;
	itk::BinaryMask3DMeshSource<MeshType>::Pointer meshSource;
	meshSource = itk::BinaryMask3DMeshSource<MeshType>::New();
	meshSource->SetInput(floatPicture);
	meshSource->SetObjectValue(1.0);


floatPicture is of type Image<float, 3> and is containing a binary image
of an object.

Kind regards,
Gunn Marie
_______________________________________________
Insight-developers mailing list
Insight-developers at itk.org
http://www.itk.org/mailman/listinfo/insight-developers


More information about the Insight-developers mailing list