[Chimera-users] How to change 32bit map into 16bit map

Tom Goddard goddard at sonic.net
Thu Apr 5 16:18:53 PDT 2018


Hi Junha,

  You use the “vop scale” command to scale and convert a 32-bit float map to 16-bit integer.  The reason you get just 4 spikes in the histogram of a converted map is because the floating point values ranged say from 0 - 3.5 and when converted to integer those get rounded to 0,1,2,3.  In order to use the full 16-bit integer range (+/-  32000) you’d want to scale the float values.  The scale factor you need depends on the range of data values (which is shown in the Volume Viewer dialog below the histogram).  So for example if the floating point range of values was 0 to 3.5 I could use

	vop scale #1 factor -8000 value int16

If you want to convert to an unsigned integer type (uint16) then you need to scale and shift the float values to put them in the range 0-65355, values out of range (e.g. negative) will be clamped (e.g. to 0).

https://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/vop.html#scale

	Tom


> On Apr 5, 2018, at 3:50 PM, Jun Ha Song wrote:
> 
> Hello,
> 
> I sometimes invert my map using Fiji, and I also convert my 32bit map into 16bit map using Fiji's "Image →  Type  → 16-bit" function, but the only way to retrieve the map from Fiji is to save the map as .tif stack, then use IMOD's "tif2mrc" to get it back as .mrc file.
> 
> However, once I save my map as .tif, the pixel spacing information of the map is set to 1,1,1. Because of this, I always have to re-adjust the pixel spacing back to original using IMOD's "alterheader" once I use Fiji for any kind of image adjustment.
> 
> I know I can invert a map in Chimera (without setting the pixel spacing to 1,1,1 like Fiji) by using "Volume Filter  → Filter Type : Scale  → Scale by -1", but I don't know how to turn my 32bit map into 16bit map.
> 
> Although the "Value Type" of scale filter allows me to specify which bit I want the map to be in, when I filter my float32 map with value type set to either int16 or uint16, the filtered map shows histogram with only few lines.
> 
> Can UCSF Chimera turn float32bit map into 16bit map?
> 
> Best,
> Junha Song.
> <ScaleFloat32to16int.png>_______________________________________________
> Chimera-users mailing list: Chimera-users at cgl.ucsf.edu
> Manage subscription: http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20180405/18ed35eb/attachment.html>


More information about the Chimera-users mailing list