Felix icon indicating copy to clipboard operation
Felix copied to clipboard

a way to turn our .bin files into nearly any other graphic format in Linux/Unix systems

Open RudoRoemer opened this issue 11 years ago • 3 comments

This line takes our high-quality example .bin file from Si and turns it into a .gif:

convert -size 539x539 -depth 64 -define quantum:format=floating-point -define quantum:scale=65535.0 -endian lsb GRAY:F-WI-M-T01000-P00539-sampleoutput-highq.bin F-WI-M-T01000-P00539-sampleoutput-highq.gif

The line uses the "convert" command which is part of the ImageMagic set of routines available on any Linux and most Unix systems. It can be scripted and we should include it in our CoW/Minerva scripts at the end: once all new .bin's have been computed we simply use "convert" to make .jpg's or similar. So there is no need for "ImageJ" manual "import" anymore.

RudoRoemer avatar Nov 12 '14 16:11 RudoRoemer

Actually I think it will still be necessary to keep the binary output in some form for quantitative work.

As far as I know, .gifs are only 8-bit images - and there is not enough dynamic range in 0->255 to represent the output properly. In particular, if different reflections are included in a montage, the weak ones may be <1% of the 000 beam and so only have 1 or 2 grey levels to use!

But this may work well for individual reflections. Presumably the data is scaled to fit a range of 255 when it is converted. However relative intensities between reflections will be lost.

You might reply that gifs can be 16-bit as well (there is a scale to 65535 in the command quoted) but can Windows machines read such an image?

Richard

On 12/11/2014 16:47, Rudolf A Roemer wrote:

This line takes our high-quality example .bin file from Si and turns it into a .gif:

convert -size 539x539 -depth 64 -define quantum:format=floating-point -define quantum:scale=65535.0 -endian lsb GRAY:F-WI-M-T01000-P00539-sampleoutput-highq.bin F-WI-M-T01000-P00539-sampleoutput-highq.gif

The line uses the "convert" command which is part of the ImageMagic set of routines available on any Linux and most Unix systems. It can be scripted and we should include it in our CoW/Minerva scripts at the end: once all new .bin's have been computed we simply use "convert" to make .jpg's or similar. So there is no need for "ImageJ" manual "import" anymore.

— Reply to this email directly or view it on GitHub https://github.com/RudoRoemer/Felix/issues/55.

Richard Beanland Dept. of Physics University of Warwick Coventry CV4 7AL

rbeanland avatar Nov 12 '14 17:11 rbeanland

Sorry, a misunderstanding:

  • yes, we can and should keep the .bin files
  • convert is the BIG gun, can convert into "any" reasonable graphics format. I just chose .gif as the .jpg would have overwritten the existing sample in my folder (the one I was comparing with).
  • tell us which format you want, "convert" should be able to give it to you (.tiff?)
  • sidesteps us having to include image conversion code into felix, at least at this stage

RudoRoemer avatar Nov 12 '14 17:11 RudoRoemer

The .bin files can be converted quite easily into 64 bit tiffs, which is good - unfortunately not many programs can read 64 bit tiffs. I am having difficulty rescaling to a 16 bit tiff using the convert command. I am sure it is possible though. Jon has written a python script which does this, and is currently being used in the gui. Will need to look into this - not very familiar with the image output of felix (or image processing in general!).

AJMHubert avatar Aug 17 '15 13:08 AJMHubert