Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
RudoRoemer opened this issue Nov 12, 2014 · 3 comments

Comments

@RudoRoemer
Copy link
Collaborator

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.

@rbeanland
Copy link
Collaborator

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
#55.

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

@RudoRoemer
Copy link
Collaborator Author

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

@AJMHubert
Copy link
Contributor

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!).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants