Author Topic: Evaluation and visual representation of three-dimensional images  (Read 3384 times)

Offline bulrichl

  • PixInsight Guru
  • ****
  • Posts: 524
Evaluation and visual representation of three-dimensional images

With growing interest I read a paper about an actually dry subject, the XISF Version 1.0 Specification (DRAFT 9.3), http://pixinsight.com/doc/docs/XISF-1.0-spec/XISF-1.0-spec.html Especially the topic of three-dimensional images aroused my interest:

In section 5, "Overview of XISF 1.0 Features", the dimensionality and the number of channels of an image are defined as distinct conceptions. In section 8.5.1 "Structure and Properties" the concept is explained in more detail, and Figure 1 - "Structure of a two-dimensional image" illustrates the case of a two-dimensional image. The second paragraph of section 8.5.2 clearly defines three-dimensional images and section 11.5.1 among other things deals with the image attribute 'geometry'.

According to this specification Pixinsight is (or will be?) ready to represent three-dimensional images internally, but as far as I am aware of, Pixinsight by now does not make use of it. I would like to have advanced processes in Pixinsight enabling to open, save, evaluate and visually represent the data of three-dimensional images. Such functionality is commonly applied in image processing in the field of e. g. medicine or biology. However, also in astrophotography one can view a stack of dark frames or a stack of light frames as a three dimensional image and I think it's worthwhile giving thought to it:

As an example, in the examination of a camera sensor I needed functionality that would let me examine a specific hot pixel (x, y) and output (as chart and as numerical data) the intensity as function of the depth (z coordinate) in a stack of dark frames.

Second example: imagine a stack of images as a cuboid. Normally, as in the case of the blink process, we look at it in a way that we see the (x, y) image of a specific z coordinate. The x axis is the direction of rows and the y axis is the direction of columns of the image. Even if blink treats the inspected images as separate, they altogether could be considered as one three-dimensional image. When we scroll through them, we virtually change the z coordinate. Now I would like to be able to (graphically) turn the cuboid in space and view it from a different direction. So you could visually represent two-dimensional (x, z) or (y, z) images and scroll through the y coordinate or the x coordinate, respectively. In this way one could e. g. rapidly and unambiguously identify cosmic ray hits.

Juan Conejero wrote in topic 4529 (August 2012): "PixInsight is an image processing and analysis platform specialized in astronomy and other technical imaging fields." Advanced functionality regarding three-dimensional images would facilitate specific evaluations and visual representations in astronomy and make Pixinsight more interesting for a broader public (potential users in other scientific fields) too.

I guess that internally in Pixinsight the needed processes are already at hand. Unfortunately my programming skills are not sufficient, otherwise I now had an interesting programming project for a JavaScript. In any case, I am curious about the further development of Pixinsight and specifically about the support of three-dimensional images. Perhaps the developers can take the time for commenting on their point of view?

Bernd

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Hi Bernd,

Those are some very interesting thoughts indeed.

It will be interesting to hear from the 'inner circle' of the PI Team, to see what their thoughs are.
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline bulrichl

  • PixInsight Guru
  • ****
  • Posts: 524
Hello Juan,

I know that you are very busy with the further development of Pixinsight. Can you still take the time and reply to my post, please?

Bernd

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Hi Bernd,

Currently PixInsight only supports two-dimensional images. I have no specific plans to implement support for 3-D images (or, for that matter, one-dimensional images). That would require a complete redesign and reimplementation of many critical core components, which is something that I cannot afford. And I will never be able to afford it, probably. Always take into account that, with the exception of a bunch of developers who write wonderful scripts and specialized tools (the INDIClient module being the most relevant example as for recent development), I am completely alone with the development and maintenance of PixInsight. Also take into account that I am 53 years old. 5 or 8 years ago I was still able to work (too) many hours a day efficiently, but now this is no longer the case. Although I am smarter now, of course ;)

The XISF format supports images of arbitrary dimensions by design. However, these capabilities probably won't ever be exploited, at least if I have to implement them. The XISF format, like so many other things and projects we have worked on all these years, will probably be forgotten "like tears in the rain". But it's being a lot of fun :)
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline bulrichl

  • PixInsight Guru
  • ****
  • Posts: 524
Hi Juan,

I understand very well what you are saying and agree, that with short resources it is wise to confine the development to the core competence of Pixinsight, image processing and analysis in astronomy. In that field, three-dimensional images are not really that important. But perhaps the evaluation of data from a stack of images could be facilitated in some form?

Only short time ago I was not aware of the outstanding potentials of scripts in Pixinsight. I am 61 and unfortunately do not have a clue about object oriented programming. If I were younger, I would like to learn programming JavaScripts by myself. But after having looked at the sourcecode of some scripts I'm not sure to be capable of that even though I now have the time for it. Besides the documentation of the Pixinsight specific objects and methods is too scarce for me. Maybe I`ll give it a try anyway but I would need a lot of assistance then.

For some specific evaluations it might indeed be more efficient for me to take a different software. Fortunately data exchange via FITS files works flawlessly between Pixinsight and other software.

Since criticism sometimes may be perceived as negative (which is not at all what I intended), I want to express here that Pixinsight is a wonderful piece of software. For me, it is worth each cent. It was not quite easy to get used to it, but after having overcome the first obstacles I couldn't imagine to process and analyze astrophotos without it. Thank you for Pixinsight, Juan. I am looking forward to the next release and am curious about the further improvements.

Bernd

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Hi Bernd,

Like you, I too shuddered at the very thought of having to work in an object-oriented environment, but I needed a solution to a problem I was facing and had nowhere to turn to - other than to myself.

So, grasping a lot of Googled knowledge, and the real bare-bones knowledge of programming acquired over thirty years ago (when coding was so much simpler), I tackled my first (and, to date, only) script inside PixInsight - a DeBayer script for CMYG imagers (such as the venerable Meade DSI I-C).

Of course, I made hundreds and hundreds of basic 'novice' errors but, with the guidance of Juan I was able to complete the script, and generate a user-interface that allowed it to be run.

I doubt that many people found a use for it, certainly not in it's 'native' state, but years later I find myself still using it. Not in its original incarnation of course, but in the form that is now included with standard PixInsight distributions - the Batch DeBayer" script.

This is because, when I wrote my version, I took the time to document the code as heavily as I could - and that has (hopefully) made life easier for those who have followed in my footsetps keystrokes.

Perhaps there might be some incentive in my code that would encourage you to tackle your own project. At least there are those amongst us (especially Juan) who might be able to find time to help you (as he helped me) if you find yourself up against apparently unsolvable problems!!
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline bulrichl

  • PixInsight Guru
  • ****
  • Posts: 524
Hi Neill,

its very nice of you to tell me this story, thank you for that. This is encouraging for me. I certainly will inspect the code of the BatchDeBayer script thoroughly - or are the detailed comments only part of your "original incarnation"?

However previously I'll have to engage deeper in learning the basics of JavaScript, which I have begun only recently. Object oriented programming languages still are new territory for me.

Bernd

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Hi Bernd,

'My' comments were included in the "Batch CMYG Deayer" script. I have to confess that I have not had the time to look at the "Batch DeBayer" script (which apparently took its inspiraton from mine), but you might be well advised to look at both.

Good luck!





























Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline bulrichl

  • PixInsight Guru
  • ****
  • Posts: 524
Hi Juan,

I continue to occupy myself with the possibility of 3-dimensional images being represented by an XISF file and tried to create a monolithic XISF file for a 3-dimensional grayscale image, width = 5202, height = 3465, depth = 10, length of XISF header: 4096 bytes, with attached XISF data block. I used the following XISF header:

Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Extensible Image Serialization Format - XISF version 1.0
Created with PixInsight - http://pixinsight.com/
-->
<xisf version="1.0" xmlns="http://www.pixinsight.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.pixinsight.com http://pixinsight.com/xsd/xisf-1.0.xsd">
   <Image geometry="5202:3465:10:1" sampleFormat="UInt16" colorSpace="Gray" location="attachment:4096:360498600">
      <FITSKeyword name="SIMPLE" value="T" comment="file does conform to FITS standard"/>
      <FITSKeyword name="BITPIX" value="16" comment="number of bits per data pixel"/>
      <FITSKeyword name="NAXIS" value="3" comment="number of data axes"/>
      <FITSKeyword name="NAXIS1" value="5202" comment="length of data axis 1"/>
      <FITSKeyword name="NAXIS2" value="3465" comment="length of data axis 2"/>
      <FITSKeyword name="NAXIS3" value="10" comment="length of data axis 3"/>
      <FITSKeyword name="EXTEND" value="T" comment="FITS dataset may contain extensions"/>
      <FITSKeyword name="COMMENT" value="" comment="FITS (Flexible Image Transport System) format is defined in 'Astronomy"/>
      <FITSKeyword name="COMMENT" value="" comment="and Astrophysics', volume 376, page 359; bibcode: 2001A&amp;A...376..359H"/>
      <FITSKeyword name="BZERO" value="32768" comment="offset data range to that of unsigned short"/>
      <FITSKeyword name="BSCALE" value="1" comment="default scaling factor"/>
      <FITSKeyword name="PROGRAM" value="'PixInsight 01.08.04.1195'" comment="Software that created this HDU"/>
      <FITSKeyword name="COMMENT" value="" comment="PixInsight Class Library: PCL 02.01.01.0784"/>
      <FITSKeyword name="COMMENT" value="" comment="FITS module version 01.01.04.0359"/>
      <FITSKeyword name="COLORSPC" value="'Grayscale'" comment="PCL: Color space"/>
      <FITSKeyword name="RESOLUTN" value="100." comment="PCL: Resolution in pixels per resolution unit"/>
      <FITSKeyword name="RESOUNIT" value="'inch    '" comment="PCL: Resolution unit"/>
      <FITSKeyword name="COMMENT" value="" comment="Decoded with PixInsight 01.08.04.1195"/>
      <FITSKeyword name="COMMENT" value="" comment="Decoded with DSLR_RAW module 01.03.05.0324"/>
      <FITSKeyword name="COMMENT" value="" comment="Decoded with dcraw version 9.27"/>
      <FITSKeyword name="INSTRUME" value="'Canon EOS 600D'" comment="Camera model"/>
      <FITSKeyword name="DATE-OBS" value="'2016-08-08T21:45:01'" comment="Camera timestamp"/>
      <FITSKeyword name="EXPTIME" value="361." comment="Exposure time in seconds"/>
      <FITSKeyword name="ISOSPEED" value="800." comment="ISO speed as specified in ISO 12232"/>
      <FITSKeyword name="FOCALLEN" value="50." comment="Focal length in mm"/>
      <FITSKeyword name="APTDIA" value="8.84" comment="Aperture diameter in mm"/>
      <Resolution horizontal="100" vertical="100" unit="inch"/>
   </Image>
   <Metadata>
      <Property id="XISF:CreationTime" type="String">2017-03-24T13:04:33Z</Property>
      <Property id="XISF:CreatorApplication" type="String">PixInsight 01.08.04.1195</Property>
      <Property id="XISF:CreatorModule" type="String">XISF module version 01.00.06.0107</Property>
      <Property id="XISF:CreatorOS" type="String">Windows</Property>
      <Property id="XISF:BlockAlignmentSize" type="UInt16" value="4096"/>
      <Property id="XISF:MaxInlineBlockSize" type="UInt16" value="3072"/>
   </Metadata>
</xisf>

and the image data of 10 images with corresponding width and height.

When I try to open that XISF file, the following two error messages show up:

"This XISF implementation only supports two-dimensional images: '5202:3465:10:1' (line=7,column=113)" and
"Premature end of document. (line=42,column=15)"

I understand that PixInsight doesn't support images with more than two dimensions - you have explained that to me in your reply above. But my question is:

Does the second error message mean that there is something missing in this XISF header, or is the header OK according to the XISF Version 1.0 Specification?

Bernd

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Hi Bernd,

Your XML code is correct. Don't worry about the "Premature end of document" error: it has been generated by Qt's XML support code, and is actually wrong, so you can just ignore it. Since the next version 1.8.5 of PixInsight we won't depend on Qt for XML support anymore because now we have our own XML parsing and generation classes.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/