[prev in list] [next in list] [prev in thread] [next in thread] 

List:       insight-users
Subject:    Re: [Insight-users] Reading / Writing BMP images.
From:       Luis Ibanez <luis.ibanez () kitware ! com>
Date:       2003-09-30 22:05:22
Message-ID: 3F79FE22.1050100 () kitware ! com
[Download RAW message or body]

Hi Rashmi,


You are right,
The code in this message only shows how to write BMP.

You will have to write the equivalent code for reading,
otherwise there will not be any fun in the task   :-)

Since the BMP header has a quite static formatting
you may follow the same structure for reading.

A good starting point is to basically replace the
bmpFile ofstream with an ifstream and then replace
all the "write" methods in the with "read" methods.

Note that BMP use some padding at the end of the lines,
this padding should be removed before you pass data
from the read lines into your image buffer.
An ImageLinearIterator may be userful in this process.
http://www.itk.org/Insight/Doxygen/html/classitk_1_1ImageLinearIteratorWithIndex.html

Iterators are explained in Chapter 11, pdf-page 481 of
the SoftwareGuide:  http://www.itk.org/ItkSoftwareGuide.pdf


Regards,


    Luis




-----------------------
rg32@njit.edu wrote:
> Thanks Luis,
> I had gone thru this code you pointed out , it can give bmp images as output 
> but has problems taking and reading a bmp image as input.Or am I missing 
> something?
> -Rashmi
> Quoting Luis Ibanez <luis.ibanez@kitware.com>:
> 
> 
>>Hi Rashmi,
>>
>>Please look at the  message posted by Marisa Aurelio:
>>
>>http://www.itk.org/pipermail/insight-users/2003-June/003952.html
>>
>>It may be nice at some point to convert
>>this code into a "BMPImageIO" class.
>>
>>
>>Regards,
>>
>>
>>    Luis
>>
>>
>>---------------------------
>>rg32@njit.edu wrote:
>>
>>
>>>Hello all,
>>>I'm trying to work with reading bmp images , processing them and again
>>
>>giving 
>>
>>>bmp images as output.ITK has no in-build bmp image readers /writers.Can
>>
>>anyone 
>>
>>>advise me as to how to proceed?
>>>Rashmi
>>>_______________________________________________
>>>Insight-users mailing list
>>>Insight-users@itk.org
>>>http://www.itk.org/mailman/listinfo/insight-users
>>>
>>> 
>>>
>>
>>
>>
>>
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users@itk.org
>>http://www.itk.org/mailman/listinfo/insight-users
>>
> 
> 
> 





[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic