MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Importing .pix files .


  • To: mathgroup@smc.vnet.net
  • Subject: [mg11209] Re: Importing .pix files .
  • From: seanross@worldnet.att.net
  • Date: Mon, 2 Mar 1998 23:11:01 -0500
  • References: <199802221955.OAA14830@smc.vnet.net.> <6d1qgg$8fo$1@dragonfly.wolfram.com> <34F524EE.4BE4@ptb.de>

Udo Huebner wrote:
> 
> Dear Sir,
> 
> I read your news comment on .pix-files but was no able to respond
> as a news post because I am new to news _and_ Mathematica. So I
> hope you will answer my question via email.
> 
> I couldn't get the "raw"-file (prepared by PaintShop Pro) to be read by
> Mathematica. The procedure I used (naive, I know!) was simply:
>    In[4]:= ReadList["C:\Bilder\Fountain\b1g.Raw"]
> and the result was
>            Read::readt : Syntax error reading &!6! (2 squares not shown)
>             from C:\Bilder\Fountain\b1g.Raw.
>    Out[4]= {Null, (6 squares), (6 squares), $Failed}
> 
> What "type" can be used in the Mathematica command or
> what is the Mathematica command to read this file?
> 
> Regards, Udo
> 
> -------------------------
> email: udo.huebner@ptb.de
> -------------------------
> 
> seanross@worldnet.att.net wrote:
> > Nilay Saha wrote:
> > >    I have a .pix file in my c:\drive. It contains SEM(Scanning electron
> > >   I want to see and manipulate this file in Mathematica. But I do not
> >
> > If your file is a more standard graphics format, the shareware program,
> > paintshop pro (www.jasc.com) can open it and transform it to a raw data
> > format which a ReadList command can open. --
> > Remove the _nospam_ in the return address to respond.


You need to look at the .RAW file in a text editor and determine its
format, then instruct ReadList accordingly.  My default trick is to
read the entire file in as a string and manipulate it with the string
commands.  When I have the file in a format that will make mathematica
happy, I use the command ToExpression to convert it over.

I also use PPM (portable pixel map) or PGM(portable grey map) format
instead of RAW.  These formats include a header which gives the image
dimensions so that you can have some chance of formating it
automatically.  RAW doesn't include anything to help you and you must
tell ReadList the format and dimensions for it to work. -- 
Remove the _nospam_ in the return address to respond.



  • Prev by Date: Re: prograMing: EquivalenceIndex
  • Next by Date: Re: prograMing: EquivalenceIndex
  • Prev by thread: Re: prograMing: EquivalenceIndex
  • Next by thread: Re: random number generation