mcberk / wrapitk

Automatically exported from code.google.com/p/wrapitk
0 stars 0 forks source link

ImageFileWriter - Support for Unsigned Long ? #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. writer = itk.ImageFileWriter.IUL2.New()
 ERROR: 'itkTemplate' object has no attribute 'IUL2'
2. writer = itk.ImageFileWriter.IUL2.New()
3. writer.SetInput( watershed.GetOutput()  )
 ERROR : TypeError: in method 'itkImageFileWriterIUC2_SetInput', argument 2
of type 'itkImageUC2 const *'

What is the expected output? What do you see instead?
I am using the WatershedImageFilter with IF2 input type. The output of the
filter (as per the docs) is an image of IUL2 type. 

What version of the product are you using? On what operating system?
3.11 unstable on Debian

Please provide any additional information below.

>>> Please let me know if I can cast/convert the image from UL to char
(with obvious loss) or change the output type of WatershedImageFilter

Original issue reported on code.google.com by sharath2...@gmail.com on 8 May 2009 at 12:16

GoogleCodeExporter commented 9 years ago
Hi,

You haven't built wrapitk with support for unsigned long (UL).

Before the writer, you should either:
* cast the output of the watershed filter with itk.CastImageFilter, which is 
likely
to make you loose some label
* relabel and cast the output of the watershed filter with 
itk.RelabelImageFilter,
which is more likely to not loose any label, but will change there value.

Then you can use the writer with a more common type, like US2.

Gaëtan

Original comment by gaetan.l...@gmail.com on 12 May 2009 at 7:03