imread in Octave 3.2.0 on Windows doesn't work for uint16 tiff

View: New views
8 Messages — Rating Filter:   Alert me  

imread in Octave 3.2.0 on Windows doesn't work for uint16 tiff

by kavermeer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

After fixing the problem with the missing magic.mgk, I now noticed that
imread doesn't seem to work for uint16. Example:

> imwrite( uint16( 12345 ), 'c:\test.tiff' );
> t = imread( 'c:\test.tiff' );
> disp( t )
2

Obviously, I expected to see 12345.

Am I doing something stupid, is this related to the packaging, or is
this something completely different?

Best,
Koen


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Octave-dev mailing list
Octave-dev@...
https://lists.sourceforge.net/lists/listinfo/octave-dev

Re: imread in Octave 3.2.0 on Windows doesn't work for uint16 tiff

by kavermeer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 2009-06-17 at 09:54 +0200, Koen Vermeer wrote:
> After fixing the problem with the missing magic.mgk, I now noticed that
> imread doesn't seem to work for uint16. Example:
> > imwrite( uint16( 12345 ), 'c:\test.tiff' );
> > t = imread( 'c:\test.tiff' );
> > disp( t )
> 2
> Obviously, I expected to see 12345.
> Am I doing something stupid, is this related to the packaging, or is
> this something completely different?

Forgot to mention: I installed GraphicsMagick-1.3.5-Q16-windows-dll on
this machine.

Koen


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Octave-dev mailing list
Octave-dev@...
https://lists.sourceforge.net/lists/listinfo/octave-dev

Re: imread in Octave 3.2.0 on Windows doesn't work for uint16 tiff

by Benjamin Lindner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Koen Vermeer wrote:

> On Wed, 2009-06-17 at 09:54 +0200, Koen Vermeer wrote:
>> After fixing the problem with the missing magic.mgk, I now noticed that
>> imread doesn't seem to work for uint16. Example:
>>> imwrite( uint16( 12345 ), 'c:\test.tiff' );
>>> t = imread( 'c:\test.tiff' );
>>> disp( t )
>> 2
>> Obviously, I expected to see 12345.
>> Am I doing something stupid, is this related to the packaging, or is
>> this something completely different?
>
> Forgot to mention: I installed GraphicsMagick-1.3.5-Q16-windows-dll on
> this machine.
>
> Koen
>

Hmm, the version bindled with the 3.2.0 installer is 1.3.3-Q8.
I can not tell for sure but I wouldn't be surprised if mixing Q8 and Q16
will result in problems.

benjamin

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Octave-dev mailing list
Octave-dev@...
https://lists.sourceforge.net/lists/listinfo/octave-dev

Re: imread in Octave 3.2.0 on Windows doesn't work for uint16 tiff

by kavermeer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 2009-06-17 at 22:01 +0200, Benjamin Lindner wrote:
> Koen Vermeer wrote:
> > Forgot to mention: I installed GraphicsMagick-1.3.5-Q16-windows-dll on
> > this machine.
> Hmm, the version bindled with the 3.2.0 installer is 1.3.3-Q8.
> I can not tell for sure but I wouldn't be surprised if mixing Q8 and Q16
> will result in problems.

I needed to install my own GraphicsMagick version to fix the magic.mgk
problem, but I can try your upcoming 3.2.0-1 to see if that one works
better. I am a bit worried though: I thought that the Q8 version doesn't
support 16 bit images. Does that mean that with your packaged Octave, I
won't be able to work with 16 bit images? If so, would I be able to
replace the bundled version with a Q16 one? Or would I be able to
convince you to bundle the Q16 version?

I now wrote a wrapper that calls 'gm convert image.tiff gray:image.raw'
and reads in the resulting raw image, but I'd rather just use imread...

Best,
Koen


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Octave-dev mailing list
Octave-dev@...
https://lists.sourceforge.net/lists/listinfo/octave-dev

Re: imread in Octave 3.2.0 on Windows doesn't work for uint16 tiff

by Benjamin Lindner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Koen Vermeer wrote:

> On Wed, 2009-06-17 at 22:01 +0200, Benjamin Lindner wrote:
>> Koen Vermeer wrote:
>>> Forgot to mention: I installed GraphicsMagick-1.3.5-Q16-windows-dll on
>>> this machine.
>> Hmm, the version bindled with the 3.2.0 installer is 1.3.3-Q8.
>> I can not tell for sure but I wouldn't be surprised if mixing Q8 and Q16
>> will result in problems.
>
> I needed to install my own GraphicsMagick version to fix the magic.mgk
> problem, but I can try your upcoming 3.2.0-1 to see if that one works
> better. I am a bit worried though: I thought that the Q8 version doesn't
> support 16 bit images. Does that mean that with your packaged Octave, I
> won't be able to work with 16 bit images? If so, would I be able to
> replace the bundled version with a Q16 one? Or would I be able to
> convince you to bundle the Q16 version?

What do you mean by a "16bit" image?

According to graphicsmagick doc Q8 means that 8bits are used per color
component. Does this not fit your needs?

benjamin

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Octave-dev mailing list
Octave-dev@...
https://lists.sourceforge.net/lists/listinfo/octave-dev

Re: imread in Octave 3.2.0 on Windows doesn't work for uint16 tiff

by Benjamin Lindner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Benjamin Lindner wrote:

> Koen Vermeer wrote:
>> On Wed, 2009-06-17 at 22:01 +0200, Benjamin Lindner wrote:
>>> Koen Vermeer wrote:
>>>> Forgot to mention: I installed GraphicsMagick-1.3.5-Q16-windows-dll on
>>>> this machine.
>>> Hmm, the version bindled with the 3.2.0 installer is 1.3.3-Q8.
>>> I can not tell for sure but I wouldn't be surprised if mixing Q8 and Q16
>>> will result in problems.
>> I needed to install my own GraphicsMagick version to fix the magic.mgk
>> problem, but I can try your upcoming 3.2.0-1 to see if that one works
>> better. I am a bit worried though: I thought that the Q8 version doesn't
>> support 16 bit images. Does that mean that with your packaged Octave, I
>> won't be able to work with 16 bit images? If so, would I be able to
>> replace the bundled version with a Q16 one? Or would I be able to
>> convince you to bundle the Q16 version?
>
> What do you mean by a "16bit" image?
>
> According to graphicsmagick doc Q8 means that 8bits are used per color
> component. Does this not fit your needs?
>
> benjamin
>

addendum: I see the same behaviour you mention with the to-be-uploaded
r2 installer.
If this is because Q8 cannot handle it, then it should be a Q16 version
I guess.

benjamin

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Octave-dev mailing list
Octave-dev@...
https://lists.sourceforge.net/lists/listinfo/octave-dev

Re: imread in Octave 3.2.0 on Windows doesn't work for uint16 tiff

by kavermeer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 2009-06-17 at 22:36 +0200, Benjamin Lindner wrote:
> Benjamin Lindner wrote:
> > What do you mean by a "16bit" image?
> > According to graphicsmagick doc Q8 means that 8bits are used per color
> > component. Does this not fit your needs?
> addendum: I see the same behaviour you mention with the to-be-uploaded
> r2 installer.
> If this is because Q8 cannot handle it, then it should be a Q16 version
> I guess.

The data I work with (medical images) are frequently grayscale, 16 bit
images (or a single 16 bit channel). I guess that in other scientific
applications, 16 bit images are also used. I'm not sure what the
downside of using the 16 bit version is.

Just a snippet from the README in the download folder of GraphicsMagick:

-x-x-
If the file has "Q8" in the name, then it is compiled to support 24/32
bit pixels. If the file has "Q16" in the name, then it is compiled to
support 48/64 bit pixels. Most users will find that the "Q8" builds to be
sufficient for their needs. They execute faster than the "Q16" builds and
take less memory. Users who are using CMS color profiles, or are
processing scientific/medical images will likely want to use a "Q16"
build. Binaries are built using Microsoft Visual Studio .net
Professional, 2002 edition, (VC++ 7.0).
-x-x-

I guess they agree with my need for 16 bits :-)

Thanks for the support!

Best,
Koen


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Octave-dev mailing list
Octave-dev@...
https://lists.sourceforge.net/lists/listinfo/octave-dev

Re: imread in Octave 3.2.0 on Windows doesn't work for uint16 tiff

by Benjamin Lindner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Koen Vermeer wrote:

> On Wed, 2009-06-17 at 22:36 +0200, Benjamin Lindner wrote:
>> Benjamin Lindner wrote:
>>> What do you mean by a "16bit" image?
>>> According to graphicsmagick doc Q8 means that 8bits are used per color
>>> component. Does this not fit your needs?
>> addendum: I see the same behaviour you mention with the to-be-uploaded
>> r2 installer.
>> If this is because Q8 cannot handle it, then it should be a Q16 version
>> I guess.
>
> The data I work with (medical images) are frequently grayscale, 16 bit
> images (or a single 16 bit channel). I guess that in other scientific
> applications, 16 bit images are also used. I'm not sure what the
> downside of using the 16 bit version is.
>
> Just a snippet from the README in the download folder of GraphicsMagick:
>
> -x-x-
> If the file has "Q8" in the name, then it is compiled to support 24/32
> bit pixels. If the file has "Q16" in the name, then it is compiled to
> support 48/64 bit pixels. Most users will find that the "Q8" builds to be
> sufficient for their needs. They execute faster than the "Q16" builds and
> take less memory. Users who are using CMS color profiles, or are
> processing scientific/medical images will likely want to use a "Q16"
> build. Binaries are built using Microsoft Visual Studio .net
> Professional, 2002 edition, (VC++ 7.0).
> -x-x-
>
> I guess they agree with my need for 16 bits :-)
>
> Thanks for the support!
>

I tried with a Q16 build of graphicsmagick-1.3.5 and your example of a
one-pixel 16-bit tiff stil fails.
But I strongly suspect this is a bug in __magick_read__.cc because it
deducts the wrong pixel depth from the modulusdepth information provided
by graphicsmagick.

I'll provide a Q16 build with 3.2.1, but __magick_read__.cc needs to be
fixed also to have correct 16-bit image support.

benjamin


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Octave-dev mailing list
Octave-dev@...
https://lists.sourceforge.net/lists/listinfo/octave-dev