Author Topic: How to record "branching" is process history  (Read 3217 times)

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
How to record "branching" is process history
« on: 2012 February 29 00:52:50 »
Hello,
I like to save the process history of an image, to be able to redo the steps modifying some parameters.  My process  sometimes "branch" a new image (for example I clone the current image, then apply some transformation and create a mask which I use in my main image process).
The "branched" image has its own history, which is fine.  However I have no trace of where the image come from, as far as I can say. I would like my main process recording the fact that I cloned the image for a purpose, so when I redo the process I do not forget to do it (and also to document the point where I branched).
Did I miss something?  Is there a 'trick' to keep that information (for example adding a Nop operation with a comment)? Is there an operation like "clone and remember the cloning point" ?
Thanks
-- bitli

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: How to record "branching" is process history
« Reply #1 on: 2012 February 29 04:22:41 »
I believe the "branched" image has a process container in step 0 of its history that contains the creation history.
Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: How to record "branching" is process history
« Reply #2 on: 2012 February 29 08:03:24 »
Hi Bitli

Every image has a processing history in PixInsight. A processing history is a read-only ProcessContainer instance with the entire sequence of applied processes. You can explore and navigate an image's processing history with the History Explorer window. You can use the View > Explorer Windows > Load History Explorer command (Ctrl+Alt+Shift+H, or Cmd+Alt+Shift+H on the Mac) to open the History Explorer loaded with the active image's history. This command is also available when you right-click on an image.

The first item in a processing history is always the initial state of the image. The initial state is a ProcessContainer with the set of processes that originated the image. It is an empty container for a just-created or just-opened image, but for a duplicate image it contains the original image's history (which can also be empty). Similarly, for an image that has been generated by a process, the initial state contains a copy of the instance that generated the image. The key concept is: nothing is lost in PixInsight.

Naturally, processing histories including their initial states are stored in projects. So what you're asking for already exists :)
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
Re: How to record "branching" is process history
« Reply #3 on: 2012 February 29 09:30:49 »
Thanks Juan,

I made an example and I now see the Process History of the derived image, very nice indeed. 
Hmmm - if I may ask (so you still have somethink to do...) would it be possible to automatically store the name of the image it is derived from  in the description of the process (in case of a copy).  For example "Clone of NGC_1234_R" ? I know it is part of the name, but once the image is renamed we lost the information of what was the original name - and nothing should got lost in PI :-)
Naturally I should use proper name conventions, but sometime I am lazy or careless (or both).
Clear skies -- bitli

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: How to record "branching" is process history
« Reply #4 on: 2012 February 29 10:55:09 »
Quote
- and nothing should got lost in P

Touchée. However, there's another design principle with higher precedence in PI: processes and images are independent each other. Or in other words: Ideally, a process knows nothing about any particular image. The whole PixInsight platform is based on this rule (it is one of the reasons why we say that PixInsight is 'object oriented'), and we have to be extremely careful to avoid violating it.

The functionality you want to have is already available: just rename your image. In this way each duplicate of it will have an instance of the ImageIdentifier process in its initial state. The instance contains the name as its 'id' parameter, which you can see in the automatically generated JavaScript code, on the History Explorer window.

Something that I have been considering for some time is the possibility to have an OpenImage internal process in the PixInsight Core application. Internal processes are those that are implemented by the core, so they don't depend on external modules. They are reserved to implement structural elements that act as pillars of the whole platform. Currently we have only two internal processes: ProcessContainer and Script. Perhaps it's time to have also OpenImage, so each image that has been loaded from disk would have an instance of it in its initial state. Maybe 1.8 will have this functionality, but I have to think on its implications. Ideas welcome, as always.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/