reset dcm window before magick read

This commit is contained in:
John Cupitt 2009-03-17 17:04:00 +00:00
parent 0c13abb9de
commit 0a3c36677b
3 changed files with 27 additions and 0 deletions

View File

@ -2,6 +2,7 @@
- revised nohalo
- remove fading stuff from im_render() -- cleaner and simpler
- configure spots support for "restrict"
- reset dcm:display-range on magick read to help DICOM
3/3/09 started 7.17.2
- im_magick2vips.c: allow funky bit depths, like 14 (thanks Mikkel)

15
TODO
View File

@ -1,3 +1,18 @@
- need to set
-define dcm:display-range=reset
to stop window_width/_height screwing up our data in magick read
use
SetImageOption (image_info, "dcm:display-range", "reset");
somewhere
- move im_shrink & friends to resample?

View File

@ -22,6 +22,8 @@
* - use image->attributes if GetNextImageAttribute() is missing
* 3/3/09
* - allow funky bit depths, like 14 (thanks Mikkel)
* 17/3/09
* - reset dcm:display-range to help DICOM read
*/
/*
@ -585,6 +587,15 @@ im_magick2vips( const char *filename, IMAGE *im )
if( !(read = read_new( filename, im )) )
return( -1 );
/* When reading DICOM images, we want to ignore any
* window_center/_width setting, since it may put pixels outside the
* 0-65535 range and lose data.
*
* These window settings are attached as vips metadata, so our caller
* can interpret them if it wants.
*/
SetImageOption( read->image_info, "dcm:display-range", "reset" );
read->image = ReadImage( read->image_info, &read->exception );
if( !read->image ) {
im_error( "im_magick2vips", _( "unable to read file \"%s\"\n"