[vtkusers] [Insight-users] how to convert the pixeltype of a image

Bill Lorensen bill.lorensen at gmail.com
Tue Sep 3 08:16:13 EDT 2013


Please provide a short compilable example that illustrates the problem.

On Mon, Sep 2, 2013 at 11:19 PM, shiwei <swingsw89 at 163.com> wrote:
> Yes, I know that ,what I'm trying to do is to read some tiff images ,but
> after reading it ,we need to use double type to process the images because
> the uchar or ushort type's accuracy is not enough, That's what I'm trying
> to. I know I can't read a float or double TIFF image, however, I'm trying to
> convert it to double after I have read them. Thanks for your help then!
>
>
>
>
>
>
> At 2013-09-03 11:04:37,"Bill Lorensen" <bill.lorensen at gmail.com> wrote:
>>You cannot write a float TIFF. Is that what you are trying?
>>
>>
>>On Mon, Sep 2, 2013 at 9:35 PM, shiwei <swingsw89 at 163.com> wrote:
>>> Tanks for your answer!However when I did what you have told, it still
>>> have
>>> some problem below:
>>>
>>> itk::ExceptionObject<0031e508>
>>>
>>> Description:itk::Error:TIFFimageIO:TIFF supports unsigned/signed
>>> char,unsigned short/signed short only.
>>>
>>> As I said before, I want to use some tiff images ,however  TIFF support
>>> unsigned/signed char,unsigned short/signed short only, so I'm still
>>> asking
>>> if there is a way to convert the uchar or ushort type to double for
>>> delica
>>> use? Thank you!
>>>
>>>
>>>
>>> At 2013-09-02 20:09:33,"Bill Lorensen" <bill.lorensen at gmail.com> wrote:
>>>>When you define your read, just template it over the image type you
>>>>want the reader to produce.
>>>>typedef itk::Image< double, 2 >         ImageType;
>>>>typedef itk::ImageFileReader<ImageType> ReaderType;
>>>>ReaderType::Pointer reader = ReaderType::New();
>>>>
>>>>
>>>>On Sun, Sep 1, 2013 at 10:41 PM, shiwei <swingsw89 at 163.com> wrote:
>>>>> Hi, When I was dealing with some tiff images, it only have two kinds of
>>>>> pixeltype to choose: char and short. However,I need to convert the
>>>>> pixeltype
>>>>> to double for delica use, I'm wondering whether ITK has a way to
>>>>> convert
>>>>> the
>>>>> pixeltype to double? Thank you!
>>>>>
>>>>>
>>>>>
>>>>> _____________________________________
>>>>> Powered by www.kitware.com
>>>>>
>>>>> Visit other Kitware open-source projects at
>>>>> http://www.kitware.com/opensource/opensource.html
>>>>>
>>>>> Kitware offers ITK Training Courses, for more information visit:
>>>>> http://www.kitware.com/products/protraining.php
>>>>>
>>>>> Please keep messages on-topic and check the ITK FAQ at:
>>>>> http://www.itk.org/Wiki/ITK_FAQ
>>>>>
>>>>> Follow this link to subscribe/unsubscribe:
>>>>> http://www.itk.org/mailman/listinfo/insight-users
>>>>>
>>>>
>>>>
>>>>
>>>>--
>>>>Unpaid intern in BillsBasement at noware dot com
>>>
>>>
>>>
>>
>>
>>
>>--
>>Unpaid intern in BillsBasement at noware dot com
>
>
>



-- 
Unpaid intern in BillsBasement at noware dot com



More information about the vtkusers mailing list