RE: How to TImage::Open a PGM file?

From: Faine, Valeri <fine_at_bnl.gov>
Date: Tue, 22 Mar 2005 12:07:39 -0500


i Valeriy,

> Hi,
> could you csend me a sample file?

You can pick the sample file from
http://www.rhic.bnl.gov/~fine/EventDisplay/tmp/CanvasPgm.html

You may want to browse the Web for more samples also,

Hope this helps,

                           Valeri

-----Original Message-----
From: owner-roottalk_at_pcroot.cern.ch [mailto:owner-roottalk_at_pcroot.cern.ch] On Behalf Of Valeriy Onuchin
Sent: Tuesday, March 22, 2005 8:50 AM
To: OKUMURA, Akira
Cc: roottalk_at_pcroot.cern.ch
Subject: Re: [ROOT] How to TImage::Open a PGM file?

Hi,
could you csend me a sample file?

Thanks. Regards. Valeriy

"OKUMURA, Akira" wrote:

> Dear ROOTers,
>
> (ROOT version 4.02/00 on Mac OS X 10.3.8)
>
> When I try to open a PGM file using the function
> static TImage* TImage::Open(const char* file, TImage::EImageFileTypes
> type = kUnknown)
> the PGM file seems to be opened as a PPM file.
> Because white to black gradations are converted to red to black
> gradations when they are 'Draw()'n.
>
> Additionally, vertical noises often appear on the image. (Not always)
> The noises contains not only R but also G and B.
>
> How can I open and draw PGM files correctly?
>
> Here is a short test macro.
>
> void test()
> {
> TImage* img;
> TCanvas* c = new TCanvas("test", "test", 600, 600);
>
> for(int i=0; i<10; i++){
> img = TImage::Open("test.pgm", TImage::EImageFileTypes::kPnm);
> img->Draw();
> c->Update();
> }
> }
>
> Sincerely,
>
> OKUMURA, Akira oxon_at_icrr.u-tokyo.ac.jp
> Institute for Cosmic Ray Research, University of Tokyo
> 5-1-5 Kashiwanoha Kashiwa Chiba 277-8582 Japan
> Tel/Fax : +81 4-7136-3153
> Skype : okumura.akira
Received on Tue Mar 22 2005 - 18:07:51 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:06 MET