PixInsight Forum

Software Development => New Scripts and Modules => Topic started by: budguinn on 2010 May 06 09:04:48

Title: Blinking Script
Post by: budguinn on 2010 May 06 09:04:48
OK, I'm spoiled.......does PI have an image blink capability?

I have MaximDl, AstroArt, CCDStack and ImagesPlus.
CCDStack is the best of the bunch for blinking....it allows me to load my images for processing....apply a stretch to the lot...and then blink through them to see if I have any obviously defective images.  I can then remove them and continue with the processing......or calibrate and save them...whatever....but it is the blink thing that I'm concerned with right now.

Does PI have this capability.....My looking, so far, hasn't found it.

If not, can it be added?....put on the wish list?

bud
Title: Re: Blink?
Post by: Carlos Milovic on 2010 May 06 09:53:06
No, it has not been implemented. It is in the to do list, but not with a high priority.
To compare two images the best way to go is using the preview system, and dropping a PixelMath instance with the name of the other image in it as expression.
With several images, this procedure is a pain... If I'm trying two or more process parameters, to determine which I like the most, I just create several previews, cloning them, and then throw those results in each one of them. Then, I can quickly compare using the preview navigation buttons (previous/next preview).
This is just a workaround. To inspect several images, with a true blinking, a specific module or core app addition should be done.

BTW, DS9 had a nice blinking feature, as some data representations I really liked.
Title: Re: Blink?
Post by: budguinn on 2010 May 06 09:56:14
thanks Carlos

this wasn't critical....I can always first load the images.......I'll usually have fifteen to thirty at a time and in CCDStack I can quickly apply a stretch and then look for the odd image out....and just delete it, then go to PI.

best regards,

bud

Title: Re: Blink?
Post by: Carlos Milovic on 2010 May 06 10:00:19
Don't worry at all about critics!!! We wellcome them. Also, your "demands" here tell us which are your current needs, and how to manage our priorities.

Thank You for all your feedback and enthusiasm!
Title: Re: Blink?
Post by: budguinn on 2010 May 06 10:08:16
Don't worry at all about critics!!! We wellcome them. Also, your "demands" here tell us which are your current needs, and how to manage our priorities.

Thank You for all your feedback and enthusiasm!

thanks for the encouragement......
when I said "this wasn't critical".....I meant it's not that big of a deal.......and I'm glad it is on a list somewhere.
Title: Re: Blink?
Post by: Silvercup on 2010 May 06 11:14:05
Hi Bud:

There is a little trick for blinking 2, 3, 4... images using workspaces. Send each image to a diferent workspace and put window in the same position.
A quick change with the workspace incons at bottom side do the blinking feature. It's very usefull to compare 2 images.

Best. Silvercup.
Title: Re: Blink?
Post by: Nocturnal on 2010 May 06 11:16:43
Actually you can just put all the images in the same workspace, maximize them at the same zoom level and use the keyboard shortcut to cycle through them.
Title: Re: Blink?
Post by: Harry page on 2010 May 06 11:25:17
Hi Bud

You are aware you can apply the stf to all open images through the image menu at the top  :D


Harry
Title: Re: Blink?
Post by: budguinn on 2010 May 06 12:04:40
Hi Bud

You are aware you can apply the stf to all open images through the image menu at the top  :D

Harry

thanks for the tip....did I miss that in one of your tuts?

bud


Title: Re: Blink?
Post by: budguinn on 2010 May 06 12:11:16
Actually you can just put all the images in the same workspace, maximize them at the same zoom level and use the keyboard shortcut to cycle through them.

thanks for the good ideas on workarounds guys, but if you haven't seen the simplicity and elegance in the CCDStack version you'll see that the workarounds are just that.

In the CCDStack app they are all perfectly aligned and you can blink them and see slight mount problems.....a double star problem because of loss of guiding (ie a cloud moving overhead)....you can see the effects of your dither and the mounts behaviour......and of course the ability to quickly isolate these problem images from the processing stack.

again, not having this feature is not a deal breaker at all, for me......it's just an  inconvenience.

With out the ability to do this it would be somewhat tedious to cull through a large number of images.
I don't see a star analyzer ability to automatically take a reference image and compare the other images to this known good image in the stack......if this could be done...such as in ImagesPlus then you could use it to sort out those images that vary greatly from a known good image.

just a thought and has been part of my processing flow.

bud

PS...and can be worked around...
Title: Re: Blink?
Post by: Harry page on 2010 May 06 12:14:03
Hi

No you did not miss it , it was not in there

When I made the newbie video's I tried not to make them complicated and all inclusive as I just wanted people to get a taste and show that good results can be achieved fairly easily  ;D

Once hooked you can then learn a lot more


Harry
Title: Re: Blink?
Post by: Harry page on 2010 May 06 12:24:14
Hi Bud

I must admit I still use AA4 to check the files before I bring them to pixinsight  :'(

I have CCD stack , but do not use it anymore as I can get better stacking results with pixinsight and being able to stack hundreds of images is also easier in PI ( I am  Not saying CCD stack is bad because its not )

Harry
Title: Re: Blink?
Post by: budguinn on 2010 May 06 12:33:15
Hi Bud

I must admit I still use AA4 to check the files before I bring them to pixinsight  :'(

I have CCD stack , but do not use it anymore as I can get better stacking results with pixinsight and being able to stack hundreds of images is also easier in PI ( I am  Not saying CCD stack is bad because its not )

Harry

Hi Harry,

I use AA4 for all of my acquisition and it does have some very nice  features, but I have been doing almost all of my processing in ImagesPlus.
I just upgraded to the new version of CCDStack....it still has, IMHO, the best deconvolve tools.  The new version takes advantage of the multiple processors.....it will now do 3000 iterations as fast as the first version did 25 iterations.  I actually heard the fans in the machine come on.....that is rare as the processor usually doesn't usually get that much of a load.  Vista has a little icon to watch processor load....and you see all four cores/processors peg themselves....really screams.

My good friend, Don McCrady (works for microsoft on the team that works with the multiple stuff) talked to the author of CCDStack.....Stan....at the last AIC and filled him in on some of the ways of implementing this.....he must have paid good attention.
I think I'm going to like the HDR and wavelets in PI a bit more, however....once I can figure out how to make an adequate star mask and stop the nasty halos/ringing.

ok.....now it's off to the golf course.....it's mens' night...

bud
Title: Re: Blink?
Post by: Harry page on 2010 May 06 12:41:41
Hi Bud

Can you tell me what halos you are getting with HDR as this is something I do not get (the only thing I get is  inverted stars )

Harry
Title: Re: Blink?
Post by: NKV on 2010 May 07 00:19:05
Hi.
Blinking script and dialog screen in attachment. ;)

Instruction (short version):
1. Try and enjoy Animation in PixInsight.

Instruction (long version):
1. Download, unzip Animation.zip any ware (for example to C:\PCL_scripts)
2. Run PI, load script (press Ctrl+Alt+E, press Ctrl+O, browse to Animation.js and open it )
3. Open only one image from your series images. Images after ImageRegistration looking much better ;)
4. Optional: Apply STF. The STF will used for other images ;) If your images require different STF, it's will looking bad... sorry. but in next version I hope to find way to apply AutoSTF individually to every image.
5. Create small Preview. Centre of the Preview will used like centre of Animation window and it's define size of window. Next version will use mouse position, now as is.
6. Run the script ( to run press F9 ).
7. Browse to your images, mark and load some of them. I don't know how much images your PC can handle, so try 2-3 images for start.
8. Press Start button. Use buttons and mouse wheel.

:)

Best regards,
Nikolay.

PS Offtop: How to move a ImageWindow via script or how to enable move it by user when JS Dialog is open?

PS2 script deleted - below there are new version.
Title: Re: Blink?
Post by: Juan Conejero on 2010 May 07 01:44:10
Nikolay, this is absolutely fantastic!

What a nice piece of code. Congratulations, and thank you for sharing it. Can I include this script with the next PI release?

Quote
How to move a ImageWindow via script

You can't, right now. A future version of PJSR will include a Workspace object, which will provide management of windows, icons and workspaces.

Quote
or how to enable move it by user when JS Dialog is open?

Impossible, since dialogs are modal windows. This means that they capture the keyboard and mouse blocking the rest of PixInsight's GUI.

However, you really don't need to create and use a new image window. A much better solution would be, IMO, an integrated view such as the one that has been implemented in the StarHaloReducer script by  Juan M. Gómez, for example.

Keep up the excellent work!
Title: Re: Blink?
Post by: NKV on 2010 May 07 02:11:30
Nikolay, this is absolutely fantastic! What a nice piece of code. Congratulations, and thank you for sharing it.
:-[

Quote
Can I include this script with the next PI release?
Yes, of course.

Quote
However, you really don't need to create and use a new image window. A much better solution would be, IMO, an integrated view such as the one that has been implemented in the StarHaloReducer script by  Juan M. Gómez, for example.
Yes, you a right... but I don't like to use HistogramTransformation. I hope you understand why...
I like to use ScreenTransferFunction. It's much much faster. So please teach me how to assign STF to parts of Dialog window.
Title: Re: Blink?
Post by: Juan Conejero on 2010 May 07 03:37:11
Quote
I like to use ScreenTransferFunction. It's much much faster. So please teach me how to assign STF to parts of Dialog window.

A STF is just a histogram transformation. You can implement this feature in several ways:

- Read the current STF of a view with the View.stf property:

Array View.stf

This property is an array with 4 elements. Array elements correspond to red/gray, green, blue and luminance, respectively.

Each array item has the following layout:

[ m, c0, c1, r0, r1 ]

where:

m is the midtones balance
c0 is the shadows clipping point
c1 is the highlights clipping point
r0 is the shadows range extension (normally not used, you can ignore it)
r1 is the highlights range extension (normally not used, you can ignore t)

m, c0 and c1 are in the [0,1] range and c0 is guaranteed to be c0 <= c1. r0 is in the range [-10,0] and r1 in [+1,+10].

- Define your own STF parameters within your script. This would require three NumericControl controls to define the corresponding parameters m, c0 and c1.

- Implement an automatic stretch feature in your script. This is actually much easier than what may seem at first glance. You have the following data:

Number Image.median()
Number Image.avgDev()

These are the median and average deviation of an image, respectively, in the [0,1] range. The median can be interpreted as the position of the main histogram peak of the image over the horizontal axis of the histogram. The average deviation is a robust estimator of dispersion, which you can visualize as the width of the histogram peak. From these values, you can define an automatic shadows clipping point as a multiple of the average deviation toward the left of the peak. You can use also:

Number Image.stdDev()

which is the standard deviation, but average deviation is more robust (= immune to outliers, that is very high and very low pixel values in this case).

Instead of those Image methods, you can use the ImageStatistics object if you prefer it. If you have to calculate several statistical moments then ImageStatistics is more efficient because you get all of them in a single call.

To compute an automatic midtones balance, you should use this method:

Number Math.mtf( Number m, Number x )

which returns the resulting value after applying a midtones balance m to an input pixel value x. Using this method, you can find the value of m required to force a particular median value in the image. This is an efficient routine that performs a binary search for m:

Code: [Select]
function findMidtonesBalance( v0, v1, eps )
{
   if ( !eps )
      eps = 1.0e-5;
   else
      eps = Math.max( 1.0e-10, eps );

   var m0, m1;
   if ( v1 < v0 )
   {
      m0 = 0;
      m1 = 0.5;
   }
   else
   {
      m0 = 0.5;
      m1 = 1;
   }

   for ( ;; )
   {
      var m = 0.5*(m0 + m1);
      var v = Math.mtf( m, v1 );

      if ( Math.abs( v - v0 ) < eps )
         return m;

      if ( v < v0 )
         m1 = m;
      else
         m0 = m;
   }
}

This routine returns the required value m such that a call to:

Math.mtf( m, v1 )

will return v0 to within +/-eps tolerance. If you set v1 = median_of_image and v0 = desired_position_of_histogram_peak, then you can know the midtones balance m that achieves your automatic adjustment.

Once you know c0, m and c1=1, your histogram transformation is:

for all pixels
   if old_pixel < c0
      new_pixel := 0
   else
      new_pixel := mtf( m, (old_pixel - c0)/(1 - c0) )
   endif
endfor

Title: Re: Blink?
Post by: budguinn on 2010 May 07 05:58:42
Nikolay,

That worked like a charm...and it worked on 30 color debayered images....each at 75 meg.

Suggestions?
Can you control the speed of the blink?
Can you add two buttons?......next and previous?

This would allow a slower blink.....stop when you see a problem....then use the next and previous keys to isolate the "problem" image and make a note of it.

What a great group of folks.....ask for something and it is done.

Title: Re: Blink?
Post by: NKV on 2010 May 07 06:31:36
Juan, thank you for explanation.

A STF is just a histogram transformation.
Maybe, but STF I can apply one time per window. HT I must apply to every image.

But I not understand how apply STF to parts of Dialog window.

I can define STF (thank's you for Image.median() and other ). I can apply STF to ImageWindow via STF.executeOn(some.image, false).
But I not understand how to show some.image inside DialogWindow.ScrollBox.Graphics with STF.
Can you show me piece of JS code.


Can you control the speed of the blink?
Can you add two buttons?......next and previous?
Of course, I will try to add all what you want and maybe more. I just start learn PJSR, so be patient. I hope in near future the script will work like in MaximDL.
Title: Re: Blink?
Post by: Carlos Milovic on 2010 May 07 06:45:07
Quote
What a great group of folks.....ask for something and it is done.

That's because:
a) Juan has no social life :D
b) we do this because we have a lot of fun
c) PI's policy regarding the PCL and PJSR is to freely give the users the ability to create their own modules and scripts
d) we are lucky enough to have some very nice users, with great programming skills :D
Title: Re: Blink?
Post by: budguinn on 2010 May 07 06:47:38
Can you control the speed of the blink?
Can you add two buttons?......next and previous?
Of course, I will try to add all what you want and maybe more. I just start learn PJSR, so be patient. I hope in near future the script will work like in MaximDL.


Patient?......you want me to be patient?.....it's been almost a full day since I made this request.  How long does a guy have to wait for many, many hours of code and development work?

Well, ok.... ;D

This is really slick, Nikolay.....thank-you

bud
Title: Re: Blink?
Post by: Harry page on 2010 May 07 11:23:01
Hi

Many thanks for doing this and look forward to the new and improved


Harry
Title: Re: Blink?
Post by: NKV on 2010 May 07 21:40:12
Hi, I am happy to introduce one more Animator zero generation. See attachment. :)

Don't forget to use mouse wheel.

PS About dark rectangle - I hope, in near future, it will grow to PhotoshopSC4 Navigator. ::)
But now it's only black rectangle. ;D

PS2 I am sorry for buttons and style. I'll fix it only after the basic controls will be written.

PS3 Niall Saunders, thank you for that post: http://pixinsight.com/forum/index.php?topic=1896.msg11759#msg11759
I printed it and use it as a step by step instructions.

PS4 script deleted - below there are new version.
Title: Re: Blink?
Post by: budguinn on 2010 May 07 22:10:11
Nikolay,

That is very slick....this gives me more capability on blinking than any of my other processing programs......very nice.

thank-you

bud guinn
Title: Re: Blink?
Post by: Harry page on 2010 May 07 23:14:05
Hi

Yes much improved, and thanks for your work  :D

The only thing I dont like is that the new created view cannot be moved and you cannot control other processes like I cannot close STF when the new image is behind the STF panel  ;)

Again many thanks

Harry
Title: Re: Blink?
Post by: NKV on 2010 May 07 23:29:47
The only thing I dont like is that the new created view cannot be moved and you cannot control other processes like I cannot close STF when the new image is behind the STF panel  ;)
I absolutely agree with you. It's very inconvenient. But Juan promised to solve the problem in next version of PI. See this post: http://pixinsight.com/forum/index.php?topic=1895.msg11741#msg11741

If you have idea how to... just say how. Maybe possible by script temporary hide other processes windows? How? Thanks.
Title: Re: Blink?
Post by: budguinn on 2010 May 08 06:41:00
Hi Nikolay,

This is working nice.....I think once we play with it we might have some more ideas, but as it is it gives a very good way to quickly check the originals, but also the stacked images.

As to hiding the windows or giving access to others.  It will probably need to to be added into the main program as one of the processes.
At that time it would be nice to have it as part of many of the other processes....such as the alignment process.  Load the images....click the blink button....examined the images....pick the ones to exclude and then align......then blink again...zoom in to see the alignment up close and personal.

I would think this would be fairly easy to implement now that the heavy lifting has been done by you.  (don't you just love how some one like me, with not a clue, tells the programmers how easy it would be to implement something?)

again, thanks,

bud
Title: Re: Blink?
Post by: NKV on 2010 May 08 09:02:59
Thank you bud. In next step I will implement list of files (for marking reference / removing bad / ect operation).
But now... Second edition.  :D

Photoshop Navigator implemented. ;)

Add: Script deleted. New version below.
Title: Re: Blink?
Post by: Harry page on 2010 May 08 09:30:20
Hi

Well it just gets better


Harry
Title: Re: Blink?
Post by: mmirot on 2010 May 08 09:41:29
great !
Title: Re: Blink?
Post by: Silvercup on 2010 May 08 13:59:19
Great. indeed

Silvercup
Title: Re: Blink?
Post by: sleshin on 2010 May 08 14:11:04
Want to add my name to the list of the grateful. Very useful script.

Steve
Title: Re: Blink?
Post by: mmirot on 2010 May 09 05:36:19
I think there is a bug. A I have problems selecting images. If I click a image in a directory it opens it.
I am not able to use windows standards : Select/ arrows, click Control, Control A

Also

How do you control display appearance ....STF?

Why do you need a preview?

Max
Title: Re: Blink?
Post by: NKV on 2010 May 09 23:13:43
Hello Max.
I think there is a bug. A I have problems selecting images. If I click a image in a directory it opens it.
I am not able to use windows standards : Select/ arrows, click Control, Control A
It's not bug. It's PixInsight limitation:
Quote
How to move a ImageWindow via script

You can't, right now. A future version of PJSR will include a Workspace object, which will provide management of windows, icons and workspaces.

Quote
or how to enable move it by user when JS Dialog is open?

Impossible, since dialogs are modal windows. This means that they capture the keyboard and mouse blocking the rest of PixInsight's GUI.

Quote
How do you control display appearance ....STF?

Why do you need a preview?
See Instruction (long Version) http://pixinsight.com/forum/index.php?topic=1895.msg11738#msg11738
Title: Re: Blink?
Post by: mmirot on 2010 May 10 07:18:07

Thanks
 Hard to get all the details. I will look forward to futures versions.

Max
Title: Re: Blink?
Post by: Silvercup on 2010 May 13 13:01:15
Hi Nikolay and all developers:

Just a little trick to force a ImageWindow to place at top left workspace:

Code: [Select]

for(var i=0;i<11;++i) {
FinalView.zoomIn();
}
FinalView.fitWindow();
FinalView.show();
FinalView.zoomToOptimalFit();



FinalView in this case is the ImageWindow object.

Silvercup
Title: Re: Blink?
Post by: NKV on 2010 May 21 10:42:35
Implement an automatic stretch feature in your script. This is actually much easier than what may seem at first glance.
I got the code.
But, for RGB images I have to generate statistics 3 times...   ??? maybe possible to get statistics for all channels at ones?
Title: Re: Blink?
Post by: Carlos Milovic on 2010 May 21 13:37:16
No. You may create an array of statistics objects, and apply them with a "for" loop (0 to numberOfChannels, or numberOfNominalChannels).
Title: Re: Blink?
Post by: NKV on 2010 May 21 21:53:35
No. You may create an array of statistics objects, and apply them with a "for" loop (0 to numberOfChannels, or numberOfNominalChannels).
Thanks. Done:
Code: [Select]
#define shadowsClipping -1.25
#define targetBackground 0.25

function AutoSTF (img,rgbLinked)
{
   var n = img.image.numberOfChannels;
   if (rgbLinked || n == 1)
   {
      for ( var c = c0 = m = 0; c < n ; c++ )
      {
         img.image.selectedChannel = c;
         var s = new ImageStatistics (img.image);
         c0 += s.median + shadowsClipping*s.avgDev;
         m += s.median;
      }
      c0 /= n;
      m = Math.mtf(targetBackground , m/n - c0 );
      var STF =[[m,1,c0,0,1],[m,1,c0,0,1],[m,1,c0,0,1],[0.5,0, 1,0,1]];
   }
   else
   {
      var STF = new Array();
      for ( var c = 0; c < n ; c++ )
      {
         img.image.selectedChannel = c;
         s = new ImageStatistics (img.image);
         c0 = s.median + shadowsClipping*s.avgDev;
         m = Math.mtf(targetBackground , s.median - c0 );
         STF.push([m, 1, c0, 0, 1]);
      }
      STF.push([0.5,0,1,0,1]);
   }
   img.stf = STF ;
}

var img = ImageWindow.activeWindow.mainView;
//var rgbLinked = true;
var rgbLinked = false;
AutoSTF(img,rgbLinked);
Actually, I just copied part of code from ScreenTransferFunctionInterface.cpp
But I not understand why original STF and this PIJS produce little bit different result of midtones balance?


 
Title: Re: Blink?
Post by: Carlos Milovic on 2010 May 21 22:09:40
Are the midtones input values close to 0.5? One way to interpret the MTF value is this: the number tells which pixel value should become middle gray. For just a inspection, I would pick something close to the image's median as MTF value.
Title: Re: Blink?
Post by: NKV on 2010 May 22 00:14:33
Are the midtones input values close to 0.5? One way to interpret the MTF value is this: the number tells which pixel value should become middle gray. For just a inspection, I would pick something close to the image's median as MTF value.
I use ImageContainer to compare results.
Script above result:
STF = [ // c0, c1, m, r0, r1
      [0.15618, 1.00000, 0.32282, 0.00000, 1.00000],
      [0.08093, 1.00000, 0.30584, 0.00000, 1.00000],
      [0.10556, 1.00000, 0.25843, 0.00000, 1.00000],
      [0.00000, 1.00000, 0.50000, 0.00000, 1.00000]
   ];


PI STF (Auto Stretch with default parameter):
STF = [ // c0, c1, m, r0, r1
      [0.15618, 1.00000, 0.32281, 0.00000, 1.00000],
      [0.08093, 1.00000, 0.30579, 0.00000, 1.00000],
      [0.10556, 1.00000, 0.25842, 0.00000, 1.00000],
      [0.00000, 1.00000, 0.50000, 0.00000, 1.00000]
   ];


 ???
Title: Re: Blink?
Post by: NKV on 2010 May 23 10:23:10
Next generation. :)
+AutoSTF
+FileList
Title: Re: Blink?
Post by: Niall Saunders on 2010 May 23 10:45:54
Very nice wotk,

I like being able to expand the window 'vertically' (to be able to see more of the list entries), but it would also be nice to expand 'horizontally' to see more of the filenames (mine tend to be rather long, and the numeric ID tends to be at the far right!!)

I need to have a look at how you are applying the AutoSTF - it would be nice to be able to 'control' the STF (even if this means doing so whilst the animation is 'stopped')

I threw 60 images (746x577, mono) into the list and at full speed it was just a pleasant 'blur' - very impressive.

I also wondered about being able to use the mousewheel to 'scroll' through the listed images. At the moment, the mousewheel affects the zoom. I don't know which function is more suited to wheel actions, zoom or image-select?

Juan, I think this deserves inclusion with v1.6.1

Cheers,
Title: Re: Blink?
Post by: NKV on 2010 May 23 11:15:06
I like being able to expand the window 'vertically' (to be able to see more of the list entries), but it would also be nice to expand 'horizontally' to see more of the filenames (mine tend to be rather long, and the numeric ID tends to be at the far right!!)
Yes, I will modify.
Quote
I also wondered about being able to use the mousewheel to 'scroll' through the listed images. At the moment, the mousewheel affects the zoom. I don't know which function is more suited to wheel actions, zoom or image-select?
Niall, just move mouse cursor to FileList and use mousewheel  ;)
Title: Re: Blink?
Post by: Niall Saunders on 2010 May 23 12:54:13
Quote
just move mouse cursor to FileList and use mousewheel

Duh, I hadn't tried that . . . .

Cheers,
Title: Re: Blink?
Post by: Juan Conejero on 2010 May 23 15:16:36
Quote
Juan, I think this deserves inclusion with v1.6.1

That's for sure. Very nice work, Nikolay!
Title: Re: Blink?
Post by: NKV on 2010 May 23 21:31:23
I like being able to expand the window 'vertically' (to be able to see more of the list entries), but it would also be nice to expand 'horizontally' to see more of the filenames (mine tend to be rather long, and the numeric ID tends to be at the far right!!)
Like that?
Title: Re: Blink?
Post by: RobF2 on 2010 May 24 04:55:08
Very very impressive.
Was just lamenting something like this to check out a bunch of images I'd collected recently.  Had even pondered trialing CCDStack.  This is a great little utility, and also speaks volumes for the software and user base to have the code laid out for all to see/use.  

Many thanks Nikolay!
Title: Re: Blink?
Post by: Harry page on 2010 May 24 10:14:24
Hi

Thanks very much for your new and improved version  ;D

I appreciate your time and work you have put into this  8)

Harry
Title: Re: Blink?
Post by: NKV on 2010 May 25 20:01:52
Thank you, and sorry for frequent updates.
One more update...
Now added a very useful (I hope) button: Auto-histograms for all images. But if you use this button, please be patient to wait until the console window will be closed.

Also, what you to like see in next version? Maybe "rename/move/delete unchecked", any other idea?

I like to see during animation ADU under mouse position and maybe whole image statistic...  ::)
maybe generate file.txt and graph of statistic's series? :o
Oh... I am going to expand simple "blinker" to "Series Analyser" :sealed:

Code: [Select]
#feature-id    Utilities > Animation
#feature-info  This script animate set of images.

#include <pjsr/NumericControl.jsh>
#include <pjsr/FrameStyle.jsh>
#include <pjsr/SampleType.jsh>
#include <pjsr/UndoFlag.jsh>
#include <pjsr/StdButton.jsh>
#include <pjsr/StdIcon.jsh>
#include <pjsr/StdCursor.jsh>
#include <pjsr/Sizer.jsh>
#include <pjsr/TextAlign.jsh>

#define shadowsClipping -1.25
#define targetBackground 0.25


function MyDialog()
{
   this.__base__ = Dialog;
   this.__base__();

   this.abort = false;
   this.busy = false;
   this.go = false;
   this.curentImage = 0;
   this.wait = 0;
   var rgbLinked = true;
   // Open files ---------------------------------------------------------------------------------------
   console.writeln("Prepare images");
   var inputFileDialog=new OpenFileDialog();
   inputFileDialog.caption="Select files for animation";
   inputFileDialog.loadImageFilters();
   inputFileDialog.multipleSelections=true;
   if (!inputFileDialog.execute())return;
   var inputFiles=inputFileDialog.fileNames;
   var Images= new Array(inputFiles.length);
   for (var i=0;i<inputFiles.length;++i)
   {
      var fileName=inputFiles[i];
      var w= ImageWindow.open( inputFiles[i] );
         if (w.length == 0)
         {
            console.writeln("Unable to process file ",fileName);
            break;
         }
      if (w[0].bitsPerSample != 16) w[0].setSampleFormat(16,false);
      Images[i]=w[0];
      if (Images[i].mainView.image.isColor) rgbLinked = false;
   }
   var img =Images[0].mainView.image;


   // prepare Animation window ---------------------------------------------------------------------------------------
   var dest = new ImageWindow(1, 1, 1,img.bitsPerSample, img.sampleType == SampleType_Real, img.isColor,"Show" );
   dest.mainView.beginProcess( UndoFlag_NoSwapFile );
   dest.mainView.image.assign( img );
   dest.mainView.endProcess();
   AutoSTF ();
   dest.zoomFactor=11;
   dest.fitWindow();
   dest.zoomFactor=-11;
   dest.fitWindow();
   dest.zoomFactor=1;
   dest.show();

   // prepare image for scroll window--------------------------------------------------------------
   var result=new Image();
   result.assign(dest.mainView.image);
   HT(result);

   console.hide();

   //---------------------------------------------------------------------------------------
   // Ensure unconditional job abortion upon dialog termination
   this.onHide = function()
   {
      this.abort = true;
      this.go = false;
      dest.forceClose();
      for (var i=0;i<inputFiles.length;++i) Images[i].forceClose();
   }

   //---------------------------------------------------------------------------------------
   // AutoSTF
   function AutoSTF ()
   {
      var img = dest.mainView;
      var n = img.image.numberOfChannels;
      if (rgbLinked || n == 1)
      {
         var c0 = 0;
         var m = 0;
         for ( var c = 0; c < n ; c++ )
         {
            img.image.selectedChannel = c;
            var s = new ImageStatistics (img.image);
            c0 += s.median + shadowsClipping*s.avgDev;
            m += s.median;
         }
         c0 /= n;
         m = Math.mtf(targetBackground , m/n - c0 );
         var STF =[[m,1,c0,0,1],[m,1,c0,0,1],[m,1,c0,0,1],[0.5,0, 1,0,1]];
      }
      else
      {
         var STF = new Array();
         for ( var c = 0; c < n ; c++ )
         {
            img.image.selectedChannel = c;
            s = new ImageStatistics (img.image);
            c0 = s.median + shadowsClipping*s.avgDev;
            m = Math.mtf(targetBackground , s.median - c0 );
            STF.push([m, 1, c0, 0, 1]);
         }
         STF.push([0.5,0,1,0,1]);
      }
      img.stf = STF ;
   }


   // ResetSTF
   function ResetSTF ()
   {
      dest.mainView.stf=[  [0.5, 1, 0, 0, 1],
                           [0.5, 1, 0, 0, 1],
                           [0.5, 1, 0, 0, 1],
                           [0.5, 1, 0, 0, 1],];
   }

   // HT
   function HT (img)
   {

      var wtmp = new ImageWindow( 1, 1, 1,img.bitsPerSample, img.sampleType == SampleType_Real, img.isColor );
      var v = wtmp.mainView;
      v.beginProcess( UndoFlag_NoSwapFile );
      v.image.assign( img );
      v.endProcess();

      var stf = dest.mainView.stf;
      var HT = new HistogramTransformation;
      if (img.isColor)
      {
         HT.H = [[stf[0][1], stf[0][0], stf[0][2], stf[0][3], stf[0][4]],
                 [stf[1][1], stf[1][0], stf[1][2], stf[1][3], stf[1][4]],
                 [stf[2][1], stf[2][0], stf[2][2], stf[2][3], stf[2][4]],
                 [ 0, 0.5, 1, 0, 1]];
      }
      else
      {
         var low=(stf[0][1]+stf[1][1]+stf[2][1])/3;
         var mtf=(stf[0][0]+stf[1][0]+stf[2][0])/3;
         var hgh=(stf[0][2]+stf[1][2]+stf[2][2])/3;

         HT.H =
            [[  0, 0.5,   1, 0, 1],
             [  0, 0.5,   1, 0, 1],
             [  0, 0.5,   1, 0, 1],
             [low, mtf, hgh, 0, 1],
             [  0, 0.5,   1, 0, 1]];
      }
      HT.executeOn( v, false ); // no swap file

      img.assign(v.image);
      wtmp.forceClose();
      return img;
   }


   //---------------------------------------------------------------------------------------
   this.UpdateImage = function()
   {
      dest.mainView.beginProcess( UndoFlag_NoSwapFile );
      dest.mainView.image.assign( Images[this.curentImage].mainView.image );
      dest.mainView.endProcess();
      this.infoLabel.text = Images[this.curentImage].mainView.id;
   }

   //---------------------------------------------------------------------------------------
   this.Animation = function()
   {
      if (!this.go) return;
      var lastCallTime = Date.now();
      var w;
      while (true)
      {
         for (;this.curentImage<inputFiles.length;++this.curentImage)
         {
            if ( this.files_TreeBox.child( this.curentImage ).checked )
            {
               if (this.wait > 0)
               {
                  while ( (w = lastCallTime + this.wait - Date.now()) > 0 )
                  {
                     if (w > 50) sleep(0.02);
                     processEvents(); if (this.abort) return;
                  }
                  lastCallTime = Date.now();
               }
               else {processEvents(); if (this.abort) return;}
               this.UpdateImage();
            }
            else {processEvents(); if (this.abort) return;}
         }
         this.curentImage=0;
      }
   }


   //---------------------------------------------------------------------------------------
   this.generate = function()
   {
      // If we are already generating data, request job abortion and return.
      if ( this.busy ) return;
      this.busy = true;
      this.abort = false;
      this.Animation();
      this.busy = false;
   };


   //---------------------------------------------------------------------------------------
   // thrumbal image for navigate

   this.ScrollControl = new Control( this );
   with ( this.ScrollControl )
   {
      var w = dest.mainView.image.width;
      var h = dest.mainView.image.height;
      var Size=200;
      setFixedSize( Size, Size*h/w );
      var k=1/w*Size;
      cursor = new Cursor( StdCursor_CirclePlus );
      onPaint = function()
      {
         // exstract viewing parts of image dest_(x0 x1 y0 y1)
         var Zoom=dest.viewportWidth/w;
         var Dx0=dest.viewportPosition.x/Zoom;
         var Dy0=dest.viewportPosition.y/Zoom;
         var Dx1=dest.visibleViewportRect.x1/Zoom;
         var Dy1=dest.visibleViewportRect.y1/Zoom;
         if (Dx1 > w) Dx1=w;
         if (Dy1 > h) Dy1=h;

         // calculate x0 x1 y0 y1 for Green rectangle
         var x0=Dx0*k;
         var y0=Dy0*k;
         var x1=x0+Dx1*k;
         var y1=y0+Dy1*k;

         var G = new Graphics( this );
         G.drawScaledBitmap( this.boundsRect, result.render() );
         G.pen = new Pen( 0xFF00FF00 ); //Green
         G.drawRect(x0,y0,x1,y1);
         G.end();
         gc();
      }
      onMousePress = function(x,y)  { dest.setViewport( x*w/Size, y*w/Size ); repaint(); }
      onMouseMove = function(x,y)   { dest.setViewport( x*w/Size, y*w/Size ); repaint(); }
      onMouseWheel = function(Dx,Dy, MouseWheel) { if (MouseWheel >0) dest.zoomOut(); else dest.zoomIn(); repaint(); }
   }


   //---------------------------------------------------------------------------------------
   // info / curent image
   this.infoLabel = new Label( this );
   with ( this.infoLabel )
   {
      frameStyle = FrameStyle_Sunken;
      margin = 2;
      text = "Push Play button";
      textAlignment = TextAlign_VertCenter;
   }

   //---------------------------------------------------------------------------------------
   // Zoom

   this.zoomFitView_Button = new ToolButton( this );
   this.zoomFitView_Button.icon = new Bitmap( ":/images/image_window/fit_view_active.png" );
   this.zoomFitView_Button.toolTip = "Fit View";
   this.zoomFitView_Button.onClick = function() { dest.fitWindow(); this.dialog.ScrollControl.repaint(); }

   this.zoomToFit_Button = new ToolButton( this );
   this.zoomToFit_Button.icon = new Bitmap( ":/images/image_window/zoom_to_fit_active.png" );
   this.zoomToFit_Button.toolTip = "Zoom To Fit";
   this.zoomToFit_Button.onClick = function() { dest.zoomToFit(); this.dialog.ScrollControl.repaint(); }

   this.zoomToOptimalFit_Button = new ToolButton( this );
   this.zoomToOptimalFit_Button.icon = new Bitmap( ":/images/image_window/zoom_to_best_fit_active.png" );
   this.zoomToOptimalFit_Button.toolTip = "Zoom To Optimal Fit";
   this.zoomToOptimalFit_Button.onClick = function() { dest.zoomToOptimalFit(); this.dialog.ScrollControl.repaint(); }

   this.zoom_1_1_Button = new ToolButton( this );
   this.zoom_1_1_Button.icon = new Bitmap( ":/images/image_window/zoom_1_1_active.png" );
   this.zoom_1_1_Button.toolTip = "Zoom 1:1";
   this.zoom_1_1_Button.onClick = function() { dest.zoomFactor=1; this.dialog.ScrollControl.repaint(); }


   //---------------------------------------------------------------------------------------
   // STF
   this.AutoSTF_Button = new ToolButton( this ); // STF
   with ( this.AutoSTF_Button )
   {

      icon = new Bitmap( ":/images/stf.png" );
      icon = new Bitmap( ":/images/copy_stf_to_window.png" );
      toolTip = "Auto ScreenTransferFunction by current image";
      onClick = function()
      {
         console.show();
         this.dialog.cursor = new Cursor( StdCursor_ArrowWait );
         AutoSTF ();
         this.dialog.cursor = new Cursor( StdCursor_Arrow );
         console.hide();
      }
   }


   this.AutoHT_Button = new ToolButton( this ); // STF2
   with ( this.AutoHT_Button )
   {
      icon = new Bitmap( ":/images/copy_stf_to_all_views.png" );
      toolTip = "Auto HistogramTransformation to all image";
      var v = true;
      onClick = function()
      {
         enabled =false;
         console.show();
         this.dialog.cursor = new Cursor( StdCursor_ArrowWait );
         if (v)
         {
            this.dialog.AutoSTF_Button.enabled = false;
            console.writeln("Auto histogram for ",inputFiles.length, " images" );
            var c=parent.curentImage; //save curent image
            for (i =0; i < inputFiles.length; i++)
            {
               console.writeln("Generate statistics for ", Images[i].mainView.id);
               parent.curentImage=i;
               parent.UpdateImage();
               AutoSTF ();
               var img = Images[i].mainView;
               img.beginProcess();
               HT(img.image);
               img.endProcess();
               console.writeln();
            }
            parent.curentImage=c; //restore
            ResetSTF ();
            parent.UpdateImage();
            icon = new Bitmap( ":images/reset_stf_to_all_views.png" );
            toolTip = "Undo HistogramTransformation";
            gc();
         }
         else //undo HistogramTransformation
         {
            console.writeln("Restoring ",inputFiles.length, " images" );

            var i=parent.curentImage; //save curent image
            for (i =0; i< inputFiles.length; i++) Images[i].undo();
            console.writeln("Generate statistics for ", Images[parent.curentImage].mainView.id);
            parent.UpdateImage();
            AutoSTF();
            icon = new Bitmap( ":/images/copy_stf_to_all_views.png" );
            toolTip = "Auto HistogramTransformation to all image";
            this.dialog.AutoSTF_Button.enabled = true;
         }
         v = !v;
         this.dialog.cursor = new Cursor( StdCursor_Arrow );
         console.hide();
         enabled =true;
      }
   }


   this.rgbLinked_CheckBox = new ToolButton( this ); // Link RGB
   with ( this.rgbLinked_CheckBox )
   {
      icon = new Bitmap( ":/images/rgb.png" );
      toolTip = "Link RGB Channels";
      checkable = true;
      checked = rgbLinked;
      enabled = !rgbLinked;
      onClick = function( value )
      {
         rgbLinked = value;
         if (this.dialog.AutoSTF_Button.enabled) this.dialog.AutoSTF_Button.onClick();
      }
   }

   this.ZoomSTF_Sizer = new HorizontalSizer;
   with (this.ZoomSTF_Sizer)
   {
      add( this.zoomFitView_Button );
      add( this.zoomToFit_Button );
      add( this.zoomToOptimalFit_Button );
      add( this.zoom_1_1_Button );
      add( this.AutoSTF_Button );
      add( this.AutoHT_Button);
      add( this.rgbLinked_CheckBox );
      addStretch();
   }


//-------------------------------------------------------
// Action buttons
   this.prevImage_Button = new ToolButton( this );
   with ( this.prevImage_Button )
   {
      toolTip = "Prev";
      icon = new Bitmap( ":/images/exit.png" );
      onClick = function()
      {
         parent.Stop_Button.onClick();
         if (parent.curentImage==0) parent.curentImage=inputFiles.length;
         parent.curentImage--;
         parent.UpdateImage();
      }
   }

   this.nextImage_Button = new ToolButton( this );
   with ( this.nextImage_Button )
   {
      toolTip = "Next";
      icon = new Bitmap( ":/images/exit.png" ).mirroredHorizontally();
      onClick = function()
      {
         parent.Stop_Button.onClick();
         parent.curentImage++;
         if (parent.curentImage==inputFiles.length) parent.curentImage=0;
         parent.UpdateImage();
      }
   }

   this.Stop_Button = new ToolButton( this );
   this.Stop_Button.toolTip = "Stop";
   this.Stop_Button.icon = new Bitmap( ":/images/view_explorer.png" );
   this.Stop_Button.onClick = function() { this.dialog.abort = true; this.dialog.go = false; }

   this.Play_Button = new ToolButton( this );
   this.Play_Button.toolTip = "Play";
   this.Play_Button.icon =  new Bitmap( ":/images/processing_console.png")
   this.Play_Button.onClick = function() { this.dialog.go = true; this.dialog.generate(); }

   this.speed_ComboBox = new ComboBox( this );
   with ( this.speed_ComboBox )
   {
      toolTip = "Delay";
      var delay = new Array (0,100,200,500,1000,2000,5000);
      var Text = new Array ("Unlimit","0.1 Sec","0.2 Sec","0.5 Sec","1 Sec","2 Sec","5 Sec");
      for ( i=0 ; i<Text.length ; i++) addItem( Text[i] );
      onItemSelected = function(i) { parent.wait = delay[i]; parent.ScrollControl.repaint(); }
   }

   //  Expand File List ---------------------------------------
   this.TreeBox_Button = new ToolButton( this );
   with ( this.TreeBox_Button )
   {
      icon = new Bitmap( ":/images/expand.png" );
      toolTip = "Show file list";
      checkable = true;
      onClick = function()
      {
         if (checked)
         {
            parent.files_TreeBox.show();
            icon = new Bitmap( ":/images/contract.png" );
            parent.adjustToContents();
         }
         else
         {
            parent.files_TreeBox.hide();
            icon = new Bitmap( ":/images/expand.png" );
            parent.adjustToContents();
         }
      }
   }


   this.PrevNextStopPlay_Sizer = new HorizontalSizer;
   with (this.PrevNextStopPlay_Sizer)
   {
      add( this.prevImage_Button );
      add( this.nextImage_Button );
      add( this.Stop_Button );
      add( this.Play_Button );
      addStretch();
      add( this.speed_ComboBox,1);
      add( this.TreeBox_Button);
   }


//----------------------------------------------------------
// File List
   this.files_TreeBox = new TreeBox( this );
   with ( this.files_TreeBox )
   {
      hide();
      rootDecoration = false;
      numberOfColumns = 1;
      headerVisible = false;
      onNodeDoubleClicked = function()
      {
         parent.curentImage = childIndex(currentNode);
         parent.UpdateImage();
      }
   }
   for ( var i = 0; i < inputFiles.length; ++i )
   {
      var node = new TreeBoxNode( this.files_TreeBox );
      node.setText( 0, Images[i].mainView.id );
      node.checked = true;
   }


   //---------------------------------------------------------------------------------------
   // arange control element
   this.sizer1 = new VerticalSizer;
   with ( this.sizer1 )
   {
      margin = 2;
      spacing = 2;
      add( this.ScrollControl );
      add( this.infoLabel );
      add( this.ZoomSTF_Sizer );
      add( this.PrevNextStopPlay_Sizer );

   }

   this.sizer = new HorizontalSizer;
   with ( this.sizer )
   {
      margin = 2;
      spacing = 2;
      add( this.sizer1 );
      add( this.files_TreeBox,1 );
   }

   this.windowTitle = "Animation";
   this.adjustToContents();
   this.setFixedHeight();
}

MyDialog.prototype = new Dialog;
function main()
{
   console.show();

   var dialog = new MyDialog;
   if (!dialog.execute()) dialog.cancel();
   gc();
}
main();
Title: Re: Blink?
Post by: Niall Saunders on 2010 May 25 23:55:00
Hi,

I don't know if you saw the graphs I posted yesterday (elsewhere on the Forum) - showing how I use MS Excel to look at the 'series analysis data' that is exported by AIP4WIN?

If you haven't got, or used, AIP4WIN, I find the Series Analysis tool a godsend. I still use it to double-check all of my data after every imaging session, before even thinking of calibration and integration.

It certainly would be useful to see something like that 'native' to PI.

I can send you screenshots if it will help.

Cheers,
Title: Re: Blink?
Post by: NKV on 2010 May 26 00:07:12
Yes, I use Series Analysis of AIP4WIN very often. So I have a chance to go in the right direction.
Title: Re: Blink?
Post by: RobF2 on 2010 May 26 01:59:19
Something similar in the "Stack" routines of Maxim - basically allowing you to assess FHWM, roundness, intensity and contrast.  First 2 particularly handy if you're talking about something similar.
Title: Re: Blink?
Post by: NKV on 2010 May 26 02:39:20
Something similar in the "Stack" routines of Maxim - basically allowing you to assess FHWM, roundness, intensity and contrast.  First 2 particularly handy if you're talking about something similar.
I will if StarStatistics module (http://pixinsight.com/forum/index.php?topic=1884) will provide whole image statistic. Now just wait or help Carlos Milovic to do it. ;)

Also, I don't have CCDInspector, so I want to see similar tools in PixInsight.
Title: Re: Blink?
Post by: RobF2 on 2010 May 26 02:49:38
Also, I don't have CCDInspector, so I want to see similar tools in PixInsight.

Oh my - that would really make some people sit up and take notice of the software!
Title: Re: Blink?
Post by: Nocturnal on 2010 May 26 07:19:58
I use DeepSkyStacker to analyze (and stack) my images. It grades images based on several parameters and assigns a score. You can then sort by any of these parameters and decide which ones to stack.

So sure, it would be great of PI to include this but it's already available for free so no rush on my account :)
Title: Re: Blink?
Post by: Carlos Milovic on 2010 May 26 08:38:20
Quote
I will if StarStatistics module will provide whole image statistic. Now just wait or help Carlos Milovic to do it.

StarStatistics is a class that performs the PSF fit just to one star. Having said that, there is no problem at all to create an array of this kind of objects, and perform fits to all stars (previously detected). The original idea was to include StarStatistics to the PCL, so every module would access to it.

At this stage, I'm confident that StarStatistics is ready to perform well, so it is just a matter of implementing such process that works with the whole image. I'll be working on a better single PSF reader... I may include new parameters that store FWHM values, so you may write a script that calls ReadPSF and then read the FWHM from it (and it should have a "mute" opcion, to disable all the console outputs). Give me a few days to do that. :)
Title: Re: Blink?
Post by: Niall Saunders on 2010 May 26 08:51:59
Quote
It grades images based on several parameters and assigns a score

The only 'shortfall' with DSS (which is 'excellent' it has to be said) is that the statistics are summarised as 'all image' statistics - which is fine for certain requirements.

I think that the idea here is that it would be great to have statistics available in PI, at the individual star level. Once available at 'Star' level, then arrays and super-arrays can be created thereafter : from one star - to all stars - to all images - to entire image group.

That way everybody gets all the flexibility that THEY need to accomplish a given task.

My 2¢-worth

Cheers,
Title: Re: Blink?
Post by: Carlos Milovic on 2010 May 26 09:03:18
Yes, I agree with you.
Once you have the individual statistics, there are lots of applications: photometry (most obvious), image quality (average all fwhms), inspect the focus plane (plot fwhm values, interpolating, as a new image, and this will give a good idea of what is happening)...
But, the first step it to be able to do that with a single star. That is ready (or, almost... needs Juan's approval :D ). Now the task is to implement that tool.
Title: Re: Blink?
Post by: Nocturnal on 2010 May 26 10:09:13

It all depends on what your purpose is. For image grading it is more useful to have whole image statistics. To analyze an individual image it is useful to have access to individual star metrics. DSS already stores metrics for all stars it detects in the <image>.txt file so it's a simple matter of writing a program that processes that data. No one's been motivated enough to do that yet :)

With individual star metrics you could do something ala CCD Inspector.
Title: Re: Blink?
Post by: NKV on 2010 May 27 05:16:53
New button "Series Analysis", like AIP4WIN whole images analysis.
Title: Re: Blink?
Post by: Nocturnal on 2010 May 27 05:48:17
Very nice! That's something else I wrote as a standalone tool a long time ago :)
Title: Re: Blink?
Post by: Niall Saunders on 2010 May 27 05:56:09
Looks great Nikolay,

I am eager to try it out 'for real' when I get back to my main PI machine.

Cheers,
Title: Re: Blink?
Post by: Niall Saunders on 2010 May 27 06:10:04
Nikolay,

I was just reading through your script, and I came across the following :-
Code: [Select]
   //---------------------------------------------------------------------------------------
   // Generat Statistics
   this.StatGen = function()
   {

      if (Boolean(this.stat[this.curentImage])) return; // generate Statistics only 1 time
      var sс = new Array();
      for ( var c = 0; c < dest.mainView.image.numberOfChannels ; c++ )
      {
         dest.mainView.image.selectedChannel = c;
         sс[c] = new ImageStatistics (dest.mainView.image);
      }
      this.stat[this.curentImage]=sс;
   }

I am not sure what you originally used when you typed in the variable declaration for sс but something doesn't seem right. I am sure it 'works', but it doesn't 'read' easily. (Yes, I know this is just a 'triviality', but I thought I would mention it anyway)

Cheers,
Title: Re: Blink?
Post by: NKV on 2010 May 27 08:20:26
I am not sure what you originally used when you typed in the variable declaration for sс but something doesn't seem right. I am sure it 'works', but it doesn't 'read' easily. (Yes, I know this is just a 'triviality', but I thought I would mention it anyway)
Hi, Niall. My mistyping. I write c in Russian keyboard layout, so I see it like sc.
Anyway, I updated the attachment. Thank you, and tell me if you see any other disadvantages.
Title: Re: Blink?
Post by: Niall Saunders on 2010 May 30 14:57:37
I like being able to expand the window 'vertically' (to be able to see more of the list entries), but it would also be nice to expand 'horizontally' to see more of the filenames (mine tend to be rather long, and the numeric ID tends to be at the far right!!)
Yes, I will modify.
Quote
I also wondered about being able to use the mousewheel to 'scroll' through the listed images. At the moment, the mousewheel affects the zoom. I don't know which function is more suited to wheel actions, zoom or image-select?
Niall, just move mouse cursor to FileList and use mousewheel  ;)

Nikolai,

I don't know if I am missing something, but I still can't get the view window to flick through the images by any other means than 'slideshow' or by clicking the 'left' and 'right' arrow icons.

As far as I can see, using the <UP> and <DN> keyboard cursor keys will select the previous or next image 'in the file list' - but they do NOT change the displayed image on the screen.

Similarly, the scroll-wheel 'scrolls' the file list up and down, without changing the highlighted file, and without changing the displayed image on the workspace.

I was looking for a quick way to 'toggle' between two images on the list, and the cursor keys seemed to be the 'natural' method, in conjunction with a duplicated method using the scrollwheel

Obviously, if the little thumbnail is 'clicked', then the scrollwheel does a perfectly good job of 'zooming' - no problem there. Maybe if the lower panel of the GUI is clicked, the scroll-wheel could then be changed to allow step-by-step movemment through the image list?

==========

Also, I thought I had hit some sort of 'fatal bug' when I clicked the "AutoHistogramTo All Images" button - I hadn't spotted the console window running through ALL of the 60 images that I had loaded. Perhaps some sort of interim "Recalculating ..." MsgBox is needed - to let the user understand that there may be some delay?

==========

I really LOVE the "Series Analysis" tool. I compared the data with that from AIP4WIN and the results were 'spot-on' (within the limits of floating-point rounding errors, anyway!). I would have preferred to see the data in [0.0, 65535.0] range and wondered whether that sort of option might be possible.

At first I thought "This would be better if it directly 'mimicked' the AIP4WIN output", but then I quickly realised that PixInsight will suddenly be able to provide a far more detailed series analysis, so there would be no advantage in 'sticking to the AIP4WIN' format - so no problems there (although I did think of a 'customisable' GUI that allowed users to select FITS header values for inclusion in the series analysis - perhaps even a GUI that allowed users to choose which of the 'soon to be many' analysis parameters that they actually needed).

In the long-term, this script will benefit from being able to 'save' and 'restore' user-customised settings - most likely it needs to behave like a 'core process', capable of dropping a PJSR 'icon' on the Workspace for later re-use, or storage.

==========

I would also have preferred a file selection window that appeared once the PJSR was running - not right at the opening stage.

It would also be great if files could be cleared, toggled, added, deleted on the list - as is common with other multi-image selectors (more like ImageIntegration and StarAlignment, but NOT like the ImageContainer interface, which I feel is too 'non-standard')

==========

In fact - for Juan here - have we now reached the stage where "multiple file/image selection" is, in itself, a 'process' that needs to be defined,  and therefore given a common GUI across ALL processes that require it?

==========

If you remember, in my original series of thoughts (on the other thread that you have already referred to, I also had tried to describe how there could be a concept of a 'BlinkMaster' image - an image that was used to blink-compare the remainder of the entire series of images, or an image that could be compared 'back-and-forth' between any other single selected image.

Can anyone think of a 'tidy way' that this notion could be implemented? Perhaps, if enabled, the 'slidehsow' would be 'turned off' and the delay timer would simply be used to toggle between the BlinkMaster and the currently selected image. As soon as a 'cursor key' (or the scroll-wheel) is ised, the BlinkMaster is then 'toggled' back-and forth between it and the 'next' (or 'previous') image in the selected file list?

==========

Could there be a possibility of 'importing' the STF from 'outside' the PJSR? In other words, you pick one of the images, set up a non-auto STF to get the image looking the way you need it to look, and then use THAT set of STF parameters for all images appearing in the Blink routine?

I can see how it would work if this was a 'core' process. You would drag-and-drop the 'apply instance' icon to the bottom of the GUI, just as we already do with the STF and Histo (where I exchange settings ALL the time now - thanks for THAT little enhancement, Juan).

Question is - can this be done inside a PJSR?

==========

Remember I mentioned the possibility of throwing a simple Dark subtraction and Flat division at the images? This would be a nice direction for this script to develop. Again, just let the user know that it will take a few seconds for the selected images to be 'calibrated'.

And, for those wishing to blink 'Bayered' images, then a simplistic deBayer process might also be a future way forward as well

==========

And now, when the user has finally selected a 'good' subset of the original data, perhaps an option could be given to actually 'do something' with those images which remain IN the selection (and for those images that were eventually EXCLUDED from the selection).

Perhaps the option to designate the remaining selection as 'good darks', from which a MasterDark could now be made (and the same would apply to all other calibration frame sub-types)

==========

Maybe this is where the script starts to 'grow arms and legs' - where separate 'tabs' start to appear. One for each sub-frame 'type'. Suddenly your excellent front-end 'blinker' becomes what ImageCalibration is crying out for.

A method of classifying ALL raw images in one go
A method of sifting through all of those raw images to ensure that only the most 'robust' data makes it into the final melting pot
A method of quickly changing a few parameters, and the re-running the ENTIRE calibration and alignment routine with one mouse-click, where ONLY those stages that NEED to be re-run actually get re-executed
A method of then being able to save the ENTIRE calibration phase as ONE (albeit complex) process icon

==========

In any case Nikolai, even with what your routine already provides, you have done excellent work - and I am sure that Juan would be delighted to include your script with the 'standard distribution', even in its current format. I would actually like to see someone take the time to help you code this as a PCL routine. It really deserves to become a mianstream 'core' module in my opinion.

Thanks for all your hard work.

Cheers,
Title: Re: Blink?
Post by: Harry page on 2010 May 31 02:03:17
Hi

Love the improved auto stf to every image if selected , I can see how bad all my images are  ;D

I have a problem that if I select statistics I cannot close the processing console down without closing down the script ;)

Now if you could just sort out the calibration , I might just buy you a beer  8)

Many thanks for your work , I will use it a lot  ;D


Harry
Title: Re: Blink?
Post by: NKV on 2010 May 31 03:16:02
Niall, thank you for attention.

using the <UP> and <DN> keyboard cursor keys will select the previous or next image 'in the file list'
Done. Now you can use <UP> and <DN> to navigate thou ALL files. and you can use <Left> and <Right> to navigate throw only Checked files. So you can select 1 image as BlinkMaster and blink it with other one.  :)

Quote
Similarly, the scroll-wheel 'scrolls' the file list up and down, without changing the highlighted file, and without changing the displayed image on the workspace.
Done. scroll-wheel = <Left> and <Right> = Previous / Next buttons. ;)

Quote
to let the user understand that there may be some delay?
Now better? MesageBox will later.

Quote
I would have preferred to see the data in [0.0, 65535.0] range
Now you can edit the script:
Code: [Select]
var r=65536;   // multiplier, write 1.0 if you like to see data in [0.0, 1,0]
var n=3;       // digits after dot.
I will populate the control with other settings and controls in next version.

Quote
Could there be a possibility of 'importing' the STF from 'outside' the PJSR? In other words, you pick one of the images, set up a non-auto STF to get the image looking the way you need it to look, and then use THAT set of STF parameters for all images appearing in the Blink routine?
If the script will take STF from active window during start? OK?

Quote
And now, when the user has finally selected a 'good' subset of the original data, perhaps an option could be given to actually 'do something' with those images which remain IN the selection (and for those images that were eventually EXCLUDED from the selection).
I see too much way to 'do something' with 'good' subset... IMHO power of PI in flexibility, implement all instruments in one tools it's utopia, so I think 'do something' much ease via HDD (copy or move or rename). But, if you want, I will try to send 'good' subset to other PI instruments (to Integrate/Calibrate/StarAligment/ImageContainer ???).

I have a problem that if I select statistics I cannot close the processing console down without closing down the script ;)
Harry, to close console just push Play button. ;)

Best regards,
Nikolay.
Title: Re: Blink?
Post by: RobF2 on 2010 May 31 04:05:46
Wow.  Thanks again Nikolay.  Can't believe how useful and how quickly this tool has come along!  :P :D
Title: Re: Blink?
Post by: Harry page on 2010 May 31 06:01:12
Hi

Thanks again , and for the tip on the play button  :D

I tell you what if you could do simple calibration in a tool like this ( I have a sx camera and do not require fancy dark thingys ) I would buy you 2 beers  8)


Harry
Title: Re: Blink?
Post by: NKV on 2010 May 31 06:50:23
I would buy you 2 beers  8)
I like beer, but right road to the beer goes through PCL. :footinmouth: I think PCL is much faster. I am right?
Title: Re: Blink?
Post by: Carlos Milovic on 2010 May 31 08:50:49
Yes, PCL modules work faster than scripts (in most cases, very few exceptions work quite at the same speed).
Title: Re: Blink?
Post by: Harry page on 2010 May 31 09:12:57
Hi

Crikey you drive a hard bargain , 3 beers then, and I don,t care if its slow  ;D


Harry
Title: Re: Blink?
Post by: Carlos Milovic on 2010 May 31 09:20:06
Talking about slow things... this reminds me when I was at a image processing course, working with MatLab. Then, I only had a Pentium 133MHz. So, I wrote a code, and tried to run it there. Acording to my estimations (from the status progress I wrote), the whole process (not a big thing) would take 2 days! So, I had to buy a 400MHz laptop, and there it only took from 2 to 3 hours :D
At this point, I gived up with matlab, and continued solving the homeworks with the PCL (btw, this was some 5-6 years ago). :P
Title: Re: Blink?
Post by: Niall Saunders on 2010 May 31 13:40:12
Thanks for the speedy update Nikolay,

I don't have time to check it out tonight - I am 'late' with a critical project for work, so I need to prioritise :'(

As soon as I get a chance to have another 'play' I will get back to you.

Cheers,
Title: Re: Blink?
Post by: Niall Saunders on 2010 June 03 09:00:40
Hi again Nikolai,

At last I have had another chance to look at the script again.

Very nice work :)

Whilst the GUI is maybe not immediately 'intuitive', a few moments spent 'getting the feel of it' and the system becomes quite 'workable' (just like any other PI interface !!)

I would like to see the ability to 'add', 'remove', 'clear all', 'select all' and 'invert selection', once the basic file list is loaded - have a quick look at my Batch deBayer GUI, which I 'stole' anyway - so I do not claim any originality whatsoever.

Basically, if I load 60 files, blink-animate these, and then decide I want to concentrate only on the first 10 (for example), it would be nice to 'deselect all' and 'select' the ten individual files - rather than having to quit the script and re-run.

Just a small detail ::)

I think your solution to 'BlinkMaster' would probably be OK. In any case, I don't really know how an A-B-C-D-E-F 'movie sequence' (with image A as BlinkMaster) would really look if it appeared as

A-B-A-C-A-D-A-E-A-F-A-B-A-C-A-D-A-E-A-F

Still, no matter what, it is great work. Can't thank you enough.

Cheers,
Title: Re: Blink?
Post by: Niall Saunders on 2010 June 03 09:07:20
Another quick one Nikolay,

(I had pressed 'Post' too soon last time :()

I wonder whether the 'statistics.txt' file should 'auto-increment' in filename (statistics-0001.txt, statistics-0002.txt, etc.) if the process is repeated on the same directory of information?

And, the reason for this is based on my next request - and that is that 'statistics.txt' should be limited to 'only' those files still currently selected from the original list.

This would allow an instant 'overall' review of the files in a directory, then a secondary review of a selected subset

Please, feel free to tell me to shut up - and to leave you alone to do something else with your life - instead of just constantly re-writing your code to satisfy some crazy Scot :police: :police: :police: (who has only just realised that he didn't even manage to spell your name correctly last time !!)

Cheers,
Title: Re: Blink?
Post by: NKV on 2010 June 07 03:40:55
Hi Niall.
Basically, if I load 60 files, blink-animate these, and then decide I want to concentrate only on the first 10 (for example), it would be nice to 'deselect all' and 'select' the ten individual files
Done. Use KeyBoard Shift / Alt / Space / Ctrl-A / Up / Done and mouse to select/deselect/invert selection.

Quote
A-B-A-C-A-D-A-E-A-F-A-B-A-C-A-D-A-E-A-F
Done. DoubleCkick to select BlinkMaster.

Quote
I wonder whether the 'statistics.txt' file should 'auto-increment' in filename (statistics-0001.txt, statistics-0002.txt, etc.) if the process is repeated on the same directory of information?
Done.

Quote
And, the reason for this is based on my next request - and that is that 'statistics.txt' should be limited to 'only' those files still currently selected from the original list.
Done.

Best regards,
Nikolay.
Title: Re: Blink?
Post by: Niall Saunders on 2010 June 07 04:40:12
Hi Nikolai,

So, 'Done', 'Done', 'Done' and 'Done' - I am obviously not setting you difficult enough tasks >:D

Again, I can't test things right now - but, based on your previously 'stellar' performance, I am sure that everything will be fantastic when I run the script this evening.

Your efforts really have been an excellent service to all of us - raising the question as to whether this particular PJSR script needs to end up migrating into the 'core' of PixInsight, as a fully-fledged PCL module. However, now that PJSR scripts can allso raise 'Process Icons' themselves (not that I have tried to do this myself yet :-\), perhaps there really isn't any need. Your PJSR may be a perfect example of a 'scripted solution' being perfectly adequate for the job.

By the way - if I had the time (and your level of skill), my 'next step' would be to add <Tabs> to the GUI, allowing different 'groups' of files to all be collated and examined. This starts to lead forwards towards the DeepSkyStacker type of interface, where images are collated and previewed prior to a full calibration run being triggered. (So, please don't think that you are 'finished' - we (or, 'I') have LOTS of work ahead for you ::))

Thanks again.

Cheers,
Title: Re: Blink?
Post by: NKV on 2010 June 07 04:59:51
So, please don't think that you are 'finished'
Yes, you are right. The script will grow.  :)
I am going to add <Tabs> to the GUI :footinmouth:
Title: Re: Blink?
Post by: Harry page on 2010 June 07 12:17:16
Hi

Really good this , many thanks for your work  :-*

Can we delete unwanted files from this script  ???


Harry
Title: Re: Blink?
Post by: Niall Saunders on 2010 June 07 15:16:11
Hi Nikolai,

OK - I have just 'tested' the new script - and it is really becoming quite powerful now.

I am not entirely sure about all the keyboard and mouse-click combinationes yet - I am not saying that they are 'wrong' or that they are 'not intuitive', I just need some time to understand all the different combinations and permutations. But, I will also read the script program itself - to get an idea of how you have implemented it.

Constructive Criticism:

1.) I don't know how other users perceive what happens when the script first loads, and you have selected your 'batch' of files. As I said, I am selecting 60 images, where individual file sizes are only 1Mb. And I have an auxilliary monitor dedicated to the permanent display of the PI Console, so I can see what is 'happening'. My concern is that other users, with much larger files, who may not 'see' the Console showing that all of the files are being loaded into 'memory', might actually not realise what is happening during this phase.

2.) If the user clicks the 'red X' on the "Select files for Animation" dialogue, the next screen that appears is just a big blank window (much, much larger than your normal GUI) - with no indication of what is happening

3.) From (1) and (2), I think that a better 'open' for the script is needed. Perhaps you could present the 'normal' GUI that you are developing, but 'inhibit' some of the controls until such time as a valid file selection has been made

4.) I like the fact that the Statistics text file is now numbered sequentially - but I think it would be well worth the extra effort 'now' (whilst the project is still in its infancy) to get the numbering to conform to a -0001, -0002, -0003, ..... sequence rather than the 'un-sortable' -0, -1, -2, ..., -9, -10, -11 sequence

5.) Right now I am really struggling to understand the mode of operation of the four 'zoom' icons. I can see what they 'do', and I can make them all 'do something', and I can (eventually) get a view that I think I am after, but the interface is definitely NOT 'intuitive'. But, then again, it isn't 'intuitive' on the main PI image windows either. I would like to suggest alternatives for the ToolTips for these icons - but my brain is too sore tonight :'( I'll try again 'next time'

6.) I also need to just clarify, in my mind, how the STF application 'works'. I know it does, and quite well, but I just need some time to associate the behaviour with the icons and ToolTips)

Some ToolTip change suggestions:-
a) Right Arrow - change from "Next Image" to "Next image"
b) Play button - change from "Play" to "Play Animation" or "Run Animation"
c) Delay listbox - change from "Delay" to "Delay between images (sec)"
    - also, change the first ListBox entry title from "Unlimit" to "0.0 sec" (and change the higher three values to also display the '.0' decimal - the list will 'look nicer')

Please remember Nikolai - all these comments are meant to be 'constructive' - this script is going to become a very useful tool for eveyone, once they see how powerful it already is.

Cheers (and thanks again),
d) The 'Statistics' button - change from "Series Analysis report" to "Export Series Analysis text file to disc" (this may eventually require a user-option to decide whether every 'analysis' is always sent to the disc)
Title: Re: Blink?
Post by: NKV on 2010 June 08 00:57:23
Hi Niall, thank you for criticism.
I am not entirely sure about all the keyboard and mouse-click combinationes yet - I am not saying that they are 'wrong' or that they are 'not intuitive', I just need some time to understand all the different combinations and permutations. But, I will also read the script program itself - to get an idea of how you have implemented it.
Current keyboard and mouse-click combinations it is standard PI combinations ;) I only stamped 'current selection' into 'Check Mark'. I prefer manipulate via 'Checked/Unchecked images', it's provide more clear visualization and understanding "whats happened?"

Quote
3.) From (1) and (2), I think that a better 'open' for the script is needed. Perhaps you could present the 'normal' GUI that you are developing, but 'inhibit' some of the controls until such time as a valid file selection has been made
When I start writing the script, I considered on fastest way to start movie, so I not like to ask users to do one more mouse click for load files... But script is growing and I will try, but many current buttons depend from opened images, so I should hide many control elements... I think to solve it via <Tabs> (Files/STF/Animation/Analyses/Settings/...)

Quote
-0001, -0002, -0003, ..... sequence
Fixed.

Quote
5.) Right now I am really struggling to understand the mode of operation of the four 'zoom' icons. I can see what they 'do', and I can make them all 'do something', and I can (eventually) get a view that I think I am after, but the interface is definitely NOT 'intuitive'. But, then again, it isn't 'intuitive' on the main PI image windows either.
You are right, it's just copy of PI interface and it's NOT 'intuitive'. I can rearrange zoom buttons vertically and put on left side ScrollControl window ( it's will exactly PI interface). Also I can add more button (zoom 1:2, 2:1). Let me know if you have any idea how to improve it.

Quote
6.) I also need to just clarify, in my mind, how the STF application 'works'. I know it does, and quite well, but I just need some time to associate the behaviour with the icons and ToolTips)
It's work like standard PI STF, I stole 'Auto Stretch' and 'Link RGB' code ;)

Quote
Some ToolTip change suggestions:-
Fixed. But, "Delay" changed to "Minimum delay between images (sec)", because the "0.0 sec" is only our wish and real delay will little bit more. ;)

Quote
d) The 'Statistics' button - change from "Series Analysis report" to "Export Series Analysis text file to disc"
I will if one of PI guru say:"I thinking and I will write Series Analysis tools. It's will like CCDInspector". But now I disagree with you. I want to grow the Analysis tools. Save to file (and show at console) is only simplest/fastest/temporary solution. I like to see not only 'numeric' report, because sometimes to understand which files is wrong don't need to ran other software (like Excel). Sometimes enough simplest Graphical report. But... but I write current 'Statistics' report only because button 'Auto Histogram Transformation to all images' share one engine with the 'Statistics' report. The AHT impossible without Statistics. So, why not... but I hope some of guru say me to kill my 'Statistics tools'.

Also, as you can see, Statistics for RGB images generate report by channels. I will populate the switcher soon. Now, if you like, you can change mode to false.
Code: [Select]
var mode=true;    // mode: sort by channel or not?
true
Image1-r
Image2-r
Image3-r

Image1-g
Image2-g
Image3-g

Image1-b
Image2-b
Image3-b




                         ?                          
false
Image1-r
Image1-g
Image1-b

Image2-r
Image2-g
Image2-b

Image3-r
Image3-g
Image3-b

And of course you can open and analyze RGB & BW images (or/and with different extension) in one pass. Should I destruct that possibility?

Best regards,
Nikolay.
Title: Re: Blink?
Post by: NKV on 2010 June 08 01:45:25
Juan, about STF and other External Objects:
Possible to run:
Code: [Select]
var st = new ScreenTransferFunction ();
st.launchInterface();
But how to kill or wait closing and collect result from?
Title: Re: Blink?
Post by: Niall Saunders on 2010 June 08 14:50:06
Hi Nikolay,

Sorry - I am too tired to look at your latest incarnation tonight - but I will look again tomorrow.

It would be good to hear from others as well- you guys need to let Nikloay know that you are happy with his efforts. I am sure that this script will have a major role to play as PI develops. Now is your chance to get PI doing things that YOU need it to do.

Harry, I agree - once the GUI 'expands' (TABS and all) then there will be 'space' for extra buttons to allow the 'selected subset' to be either re-named and/or transferred to another directory (as happens with the ImageContainer, for example). I am sure that Nikolay will be keeping this in mind.

Cheers,
Title: Re: Blink?
Post by: NKV on 2010 June 09 11:59:13
Ok, next version with new button: "Add Files"

2.) If the user clicks the 'red X' on the "Select files for Animation" dialogue
Niall, try to clicks the 'red X' now :)

Best regards,
Nikolay.

PS 'Close all' and 'Close selected' doesn't work, it is just decoration now.
Title: Re: Blink?
Post by: Harry page on 2010 June 09 12:21:33
HI

I like the decoration  ;)

I keep saying it , but I appreciate the hard work

Harry
Title: Re: Blink?
Post by: RobF2 on 2010 June 09 23:03:04
Yep - just outstanding
This script is the first place I'm going now everytime a have more than few frames on an object, to get started on processing. 

 :P
Title: Re: Blink?
Post by: Juan Conejero on 2010 June 10 01:57:39
Hi Nikolay,

Just a note to say that you're doing a terrific work. Definitely this has to be included in the next version. With 1.6.1, you'll be able to position windows and icons arbitrarily on PI workspaces (the new Workspace PJSR object), so your script will be even more shining ;)
Title: Re: Blink?
Post by: NKV on 2010 June 10 04:26:40
Next one. :)
I like the decoration  ;)
The decoration working  now.

Just a note to say that you're doing a terrific work.
You too. ;)

Juan, sorry... I stole engine of your TranslucentPlanets.
Title: Re: Blink?
Post by: Juan Conejero on 2010 June 10 15:14:08
The Movie!

http://pixinsight.com/videos/blink-script/blink-the-movie-1.mov

8)
Title: Re: Blink?
Post by: georg.viehoever on 2010 June 10 15:21:30
Wow 8)
Title: Re: Blink?
Post by: Juan Conejero on 2010 June 10 16:32:51
Glad you liked it ;) Was just a 'moment of forgiveness' for myself after a hard day of coding.

By the way, the application is the new 64-bit version for Mac OS X. As can be seen, it is completely stable now and works fast and fine. There are some glitches that the video doesn't show but are of minor importance.

Needless to say that the song is Closer to Fine by the Indigo Girls. Hope I am not violating copyrights here; this video is just for fun; it isn't an official one, of course!

Oops! I forgot to say that the images are by Oriol Lehmkuhl and Ivette Rodríguez.

That's it!
Title: Re: Blink?
Post by: mmirot on 2010 June 10 19:12:55
Good taste in Music too.
That was fun

Max
Title: Re: Blink?
Post by: NKV on 2010 June 10 22:39:10
Juan, thanks for the video. It's pleasure.
Nice to know that my attempts to explore the scripting is not indifferent for PixInsight community.
Title: Re: Blink?
Post by: Niall Saunders on 2010 June 11 00:00:56
Sorry Nikolay,

I have just downloaded Juan's movie, and couldn't care less about your script now ;D - the music was the 'star' of that show, so I am off to the iTunes store to download it for myself ::)

The one bit that Juan 'missed' was the use of BlinkMaster - but, maybe I am the only person who would use it anyway (so, please don't remove it in any future development)

Thanks all.

Cheers,
Title: Re: Blink?
Post by: Harry page on 2010 June 11 13:02:05
Hi Juan

Ok you have had your fun, now its time to get back to the kitchen  >:D


Mind you it was nice to see I am not the only one with focus shift  :surprised:


Harry
Title: Re: Blink?
Post by: NKV on 2010 June 14 09:15:25
Hello guys. New version.
+ save selected to
+ crop selected by green rectangle and save to
+ Statistics by green rectangle
+ Settings dialog + Instance button ;)

to do: add mode precise adjustments green rectangle - I want to use his coordinates in ReadPSF 8)

Please don't hesitate to kick me if I forgot one of your wishes.
Title: Re: Blink?
Post by: Harry page on 2010 June 14 10:44:19
Hi

I am running out of ideas for you to do  ;D  I am sure niall will have a few


Harry
Title: Re: Blink?
Post by: Niall Saunders on 2010 June 14 13:18:50
I am not avoiding you Nikolay - just some other things with 'higher priority' (and too many Interrupt Service Requests, often leading to an Internal Stack Overflow :'()

Cheers,
Title: Re: Blink?
Post by: NKV on 2010 June 18 23:35:09
+ mode of precise adjustments green rectangle. Hold <Ctrl> + Mouse over the small window. and keyboard bug solved.
+ Statistics data in the file list. (but note: the data only for one channel)

to do : sort by statistics data. I can't enable it now ( TreeBox.headerSorting = true ) , because I don't found any onHeaderSorted = function()  ???
Title: Re: Blink?
Post by: Niall Saunders on 2010 June 19 03:40:27
Hi Nikolay,

Is there any chance that you can renumber your updates? It makes the new versions easier to download (without having to rename, delete, or overwrite the previous versions already in my machine).

I am busy doing a full system rebuild, so will hopefully get a chance to 'play' with your new script later today.

Cheers,
Title: Re: Blink?
Post by: NKV on 2010 June 19 05:30:20
Is there any chance that you can renumber your updates? It makes the new versions easier to download (without having to rename, delete, or overwrite the previous versions already in my machine).
Thanks Niall. Noted.

PS. Script was updated again, sorry... one bug in Statistics parts was corrected.
Title: Re: Blinking Script
Post by: mmirot on 2010 July 14 06:08:49
Where is the last version of this script?

Max
Title: Re: Blinking Script
Post by: Niall Saunders on 2010 July 14 17:02:27
Where is the last version of this script?

Max

Hi Max,

Have a look at reply #101

Cheers,
Title: Re: Blinking Script
Post by: Enzo De Bernardini on 2010 July 30 10:11:16
I really like this script. I have a question: there is a way to see the images in their original aspect? (when open the image set automatically applies a similar -or equal- to STF, and sometimes I would like to examine them unchanged)

Thanks for this great job!,

Best regards,

Enzo.
Title: Re: Blinking Script
Post by: NKV on 2010 July 30 10:17:55
I really like this script. I have a question: there is a way to see the images in their original aspect? (when open the image set automatically applies a similar -or equal- to STF, and sometimes I would like to examine them unchanged)

Thanks for this great job!,

Best regards,

Enzo.

OK, I can add button for you. Anything else?
Title: Re: Blinking Script
Post by: Enzo De Bernardini on 2010 July 30 10:29:18
Quote
OK, I can add button for you. Anything else?

You're fast :D

Just that. Thank you very much!

Title: Re: Blinking Script
Post by: Niall Saunders on 2010 July 31 00:58:42
Hi Nikolay,

I think it might be useful if you could post a 'new link' to the latest version of the script.

Keep up the good work.

Cheers,
Title: Re: Blinking Script
Post by: NKV on 2010 August 05 00:22:45
Hello guys. New version 2.2.
+ new button: Reset STF and Histogram.
Title: Re: Blinking Script
Post by: Niall Saunders on 2010 August 05 02:51:38
Thanks Nikolay,

Once again, I will have a look at it once I get back to my 'main machine' tonight.

Cheers,
Title: Re: Blinking Script
Post by: NKV on 2010 August 05 03:36:29
beer ... Who promised a beer?
Ver 2.3
+ Simple dark subtraction :)
Title: Re: Blinking Script
Post by: Niall Saunders on 2010 August 05 06:07:59
An animation script requires a special beer delivery. Enjoy (responsibly ::))
Title: Re: Blinking Script
Post by: Enzo De Bernardini on 2010 August 05 08:23:36
Thanks Nikolay! Splendid work! I tried it and it worked perfectly. Great!  :D

Enzo.
Title: Re: Blinking Script
Post by: Harry page on 2010 August 05 10:22:52
Hi

Excellent work again  :D

Now for people like me who do not use darks , I am sure you could make this script divide a flat and apply a bias calibration done would be great inspect all images , do a simple calibration and save them to file, ;D


Yes I know more beer required :moneyinmouth:

Harry
Title: Re: Blinking Script
Post by: NKV on 2010 August 05 20:21:58
Hi, Harry.
divide a flat and apply a bias calibration
Yes. I will. But note: in your case dark=bias.

Also, I think about fast (real time) switch between calibrated / not calibrated view. But it's required twice volume  of memory...

Now, if you choose dark1, then dark2,... and again choose dark1, you will every time wait until the script recalculate all Light.
Current method don't requite additional RAM(and I use Redo/Undo to fastest method of reopen original Light), but impossible real-time switching between two dark :sad:     
So, if we prefer to see real-time results compare of applying different bias+dark+flat+flatdark it's require huge of RAM.

Also, what about the bit depth of files after the calibration? Now, the bit depth before = after calibration. I prefer minimum to increase it twice... requite additional RAM if we like to see "real" result of calibration. I say "real" (not real-time), because I can add to the script one trick: I can decrease bit depth of Light (file in memory) to screen resolution. In that way 1) we must forgot about STF and use only "slow" HistogramTransformation. I mean "slow", because STF need to apply to one frame, HT need to apply to every Light. 2) Statistics require original files (without HT and in full bit depth), so will work from HDD - it's will slow.

So I don't sure about usability of the script... :-\

Yes I know more beer required :moneyinmouth:
Thanks. No need more, Niall brought enough beer. (http://www.kolobok.us/smiles/artists/just_cuz/JC_burp.gif)
Title: Re: Blinking Script
Post by: NKV on 2010 August 06 01:38:21
Ver 2.4
+Reset master dark button.

Ver 2.5
+Show Calibrated button (real-time switch), so current version required double amount of RAM. Push me if I go by wrong way.
Title: Re: Blinking Script
Post by: Enzo De Bernardini on 2010 August 06 09:43:53
Great work Nikolay! Thanks!

A minor detail: using the MasterDark and reseting it, when you close the script the postfix "_c" images remains open (hidden)

Best regards,

Enzo.
Title: Re: Blinking Script
Post by: Harry page on 2010 August 06 10:42:39
Hi

I am sure a man of your kaliver can manage to do it  :D


If beer won't do it , are we talking vodka  ;D


Harry
Title: Re: Blinking Script
Post by: Nocturnal on 2010 August 06 12:48:52
Judging by the use of the word 'kaliver' it sounds like you've hit the vodka already Harry :)

 
PS currently in Holland so I'm 6h ahead of my usual EST timezone.
Title: Re: Blinking Script
Post by: Harry page on 2010 August 06 12:57:42
Hi

I know it looks funny , a bit of a local english slang   for caliber but you knew that  O0


Harry
Title: Re: Blinking Script
Post by: Nocturnal on 2010 August 06 14:19:18
yes, context is a wonderful thing :)
Title: Re: Blinking Script
Post by: Enzo De Bernardini on 2010 August 06 21:13:17
Ver 2.6
A minor detail: using the MasterDark and reseting it, when you close the script the postfix "_c" images remains open (hidden)
Fixed.

Cool. Perfect.
Title: Re: Blinking Script
Post by: NKV on 2010 August 06 23:48:09
Cool. Perfect.
Thanks.
I found more bug around Add/Close/CloseAll button if dark file selected. Fixed.

+ SaveTo/Crop&SaveTo now save file from RAM (before it just copy from original file location). Saving from RAM are much faster and possible to save calibrated files and/or save with AutoHistogramTransformation.

+ SampleFormat for calibrated images.
Ver 2.8
Title: Re: Blinking Script
Post by: Carlos Milovic on 2010 August 18 08:28:10
Hey Nikolay

Just to say that you are doing a great job here :)

BTW: Is there a way to write an animated gif (or mpg movie) with the "current" settings? :D
Title: Re: Blinking Script
Post by: Niall Saunders on 2010 August 18 09:13:17
Hi Carlos,

With no facility for creating either Animated GIFs or MPEG Movies within PI, I think that the best, and easiest, way would be to run the BlinkScript and then to screen capture as a movie.

Obviously this requires some package that will capture the screen as a movie - I am using Camtasia, and I believe Harry does the same for his tutorials. I am not sure what Juan uses, and I do not know what else might be available out there. Camtasia is certainly NOT cheap >:(

Cheers,
Title: Re: Blinking Script
Post by: Nocturnal on 2010 August 18 10:29:42
Hi,

camstudio is a reasonable alternative to camtasia. It's free which helps :)

http://camstudio.org/
Title: Re: Blinking Script
Post by: Carlos Milovic on 2010 August 18 10:32:15
Linux based? :P I guess I shall try avidemux...
Title: Re: Blinking Script
Post by: Nocturnal on 2010 August 18 10:34:25
Meh, you choose your platform and suffer the consequences :)
Title: Re: Blinking Script
Post by: Niall Saunders on 2010 August 19 06:13:19
Thanks for the link to Camstudio Sander,

I'll download and try it out over the next few days - Camtasia has fulfilled its purpose, but at huge expense, and not actually without some major gripes. At the price they are asking for Camstudio, it seems like excellent value for money :moneyinmouth:

Cheers,
Title: Re: Blinking Script
Post by: Nigel Ball on 2010 August 27 15:43:18
This might be a bit late in the day but another feature I like in CCDStack is the ability to double click on a star and get the FWHM for that star on all images open (in the Image Manager). Very useful when assessing the subs before a combine to weed out those with poor focus or haze or cloud passed over

Nigel
Title: Re: Blinking Script
Post by: Niall Saunders on 2010 August 28 00:56:09
Hi Nigel,

In fact, the way that these scripts are developed (just like PixInsight in general), it is really NEVER 'too late'.

The only restriction will be down to when someone has the skill and time to implement it - and I can certainly see the merit of your suggestion (the ability to 'score' a series of images by virtue of the FWHM of just a single star - obviously the images have to be registered/aligned to make the 'detection' of the star a 'trivial' process for all images.

There is one other minor restriction, and that is that we do not yet really have a fully integrated 'FWHM Calculator' - this has existed in various forms, but is not yet part of the 'core' of PI. Therefore, anybody adding a facility such as yours is going to have to rely on the work of others (which might not be present in a given installation), or is going to have to seek permission to have it included with THEIR code, or is going to have to write the code from scratch.

If I had Nikolay's skills (I wish :sad:) then I would be waiting for an FWHM option to appear 'inside' the core of PI - and then just make simple calls to that process from withim my script.

All that said, looking at the 'Noise Estimate' in ImageIntegration has actually given me a better 'feel' for image quality than almost all other methods - to the extent that, yes, whilst I would like to be able to 'graph' the FWHM data (not just for 'one' star, but for 'all easily detectable' stars), I would only be using the knowledge as a 'sanity check' - to help me visualise how an imaging session actually 'performed'.
Title: Re: Blinking Script
Post by: Carlos Milovic on 2010 August 28 07:24:30
Another suggestion (I already wrote the script that performs this task, but it would be better inside Nikolay's one): perform a series analysis for just a single pixel. This means, give some basic statistic data, and plot the intensity versus "time" in a new window.

To get the stats easily you may create a new image (for inner calculations) with 1 px height, and N px wide. Just copy one by one the values, and finally perform the statistics over this image (using the standard tools, not by hand).

What I have not implemented, and would be great here, is to dynamically set the coordinates (clicking on the target image).


What do you think?


PS: I'll upload a part of my code this Monday (it is at the office)
Title: Re: Blinking Script
Post by: Nocturnal on 2010 August 28 10:42:09
I use DeepSkyStacker's whole image FWHM analysis to weed out bad images. DeepSkyStacker Live does this analysis automatically as new images come in and plots values in a chart. Handy for monitoring an image session and being alerted to problems as they occur.
Title: Re: Blinking Script
Post by: Carlos Milovic on 2010 September 01 10:51:12
Code: [Select]
function EvolutionEngine()
{
   this.inputFiles = new Array;
   this.bitsPerSample = 8;
   this.floatSample = false;
   this.xev = 0;
   this.yev = 0;


   this.processFiles = function()
   {
      var fileName = 'analysis';
      fileName = File.appendToName( fileName, '_x' );
      fileName = File.appendToName( fileName, Number.toString(this.xev));
      fileName = File.appendToName( fileName, 'y');
      fileName = File.appendToName( fileName, Number.toString(this.yev) );
      //fileName = File.appendToName( fileName, '_x'+Number.toString(this.xev)+'y'+Number.toString(this.yev) );

      var filenamePlot = File.appendToName( fileName, '_plot' );
      var filenameEvo = File.appendToName( fileName, '_evolution' );

      var wPlot = new ImageWindow(this.inputFiles.length, 1001, 1,8, false, false, 'plot');
      var wEvo = new ImageWindow(this.inputFiles.length, 1, 1, 32, true, false, 'pixelEvolution');

      var vPlot = wPlot.mainView;
      vPlot.beginProcess (UndoFlag_NoSwapFile);
      vPlot.image.apply(1);

      var vEvo = wEvo.mainView;
      vEvo.beginProcess (UndoFlag_NoSwapFile);


      for ( var i = 0; i < this.inputFiles.length; ++i )
      {
         var w = ImageWindow.open( this.inputFiles[i] );

         if ( w.length == 0 && i+1 < this.inputFiles.length )
         {
            var msg = new MessageBox( "<p>Unable to load input image file:</p>" +
                                      "<p>" + this.inputFiles[i] + "</p>" +
                                      "<p><b>Continue pixel evolution analysis ?</b></p>",
                                      TITLE, StdIcon_Error, StdButton_Yes, StdButton_No );
            if ( msg.execute() == StdButton_No )
               break;
         }


         for ( var j = 0; j < w.length; ++j )
         {

            var view = w[j].mainView;
            view.beginProcess (UndoFlag_NoSwapFile);

            var f = view.image.sample(this.xev,this.yev,0);
            vEvo.image.setSample( f,i,0);
            var p = 1000-Math.round(1000*f);
            for ( var k = p; k <= 1000; ++k )
              vPlot.image.setSample( 0,i,k);

            view.endProcess();
            w[j].forceClose();
         }
      }

      vPlot.endProcess();
      vEvo.endProcess();

      wPlot.show();
      wEvo.show();

   }
}

var engine = new EvolutionEngine;

As promised... hope this helps (and you takes the ball ;) )
Title: Re: Blinking Script
Post by: NKV on 2010 September 01 23:57:03
As promised... hope this helps (and you takes the ball ;) )
Thanks Carlos.
One question: Why you use:
Code: [Select]
for ( var j = 0; j < w.length; ++j )I not understand in which situation w.length > 1 ?

Any way... ver 2.9
+evolution analysis
PS there are error. so, don't try to use it on single image. fixed
Title: Re: Blinking Script
Post by: Carlos Milovic on 2010 September 02 04:24:23
To be honest, I didn't understand that either :D I just used the batch format script as base, and if Juan wrote that, it should have been for a good reason :D  Anyway, that works :P
Title: Re: Blinking Script
Post by: Carlos Milovic on 2010 September 02 12:42:39
Just tried the new feature :) really fast, and works pretty well. Congrats ;)
Title: Re: Blinking Script
Post by: NKV on 2010 September 02 21:46:31
Thanks Carlos.
I updated the script above (fixed zero-division problem).
Note, i add auto min/max rejection. So the graph show only distribution between mim/max values in sequence of images.
Also, because the script operate at images in memory, impossible to analyze QTY of images, so independent version of EvolutionEngine is good idea.
Title: Re: Blinking Script
Post by: Carlos Milovic on 2010 September 03 06:26:09
In fact, this was exactly the same motive why I wanted that to be in your script ;) Mine loaded the images at requests, and this may get pretty boring if you want to inspect several points.
Title: Re: Blinking Script
Post by: mmirot on 2010 September 16 21:19:45
I get a syntax error on line #1 on all the latest version of this script.

Max
Title: Re: Blinking Script
Post by: NKV on 2010 September 16 21:48:26
I get a syntax error on line #1 on all the latest version of this script.

Max
Max, please show me report from Processing Console or Print Screen with the error.
Title: Re: Blinking Script
Post by: Carlos Milovic on 2010 September 17 08:46:16
Quote
One question: Why you use:
Code:

for ( var j = 0; j < w.length; ++j )

I not understand in which situation w.length > 1 ?


I figured out that cicle. It is there in the case of stored arrays of images. I think that FITS and TIFF support multiple images to be stored in a single file.
Title: Re: Blinking Script
Post by: mmirot on 2010 September 17 17:25:40
I get a syntax error on line #1 on all the latest version of this script.

Max
Max, please show me report from Processing Console or Print Screen with the error.

Nevermind,

The script is ok. Fantastic work in fact.
Another kind of problem with my last install was messing it up.

Max
Title: Re: Blinking Script
Post by: mmirot on 2010 September 26 20:11:49
When I try " save selected" it only saves a single image.
( I made a new directory first)
I assume it was intended to save all checked images.

Max
Title: Re: Blinking Script
Post by: NKV on 2010 September 26 20:20:36
When I try " save selected" it only saves a single image.
I think you select only one file.
Note: Selected and checked is different. ;) Try again or show me PrintScreen.
Title: Re: Blinking Script
Post by: Carlos Milovic on 2010 September 26 20:32:19
Don't know if this has been implemented yet... Is there a way to blink using one reference frame (fixed) between the others?
Title: Re: Blinking Script
Post by: NKV on 2010 September 26 22:37:29
Don't know if this has been implemented yet... Is there a way to blink using one reference frame (fixed) between the others?
Double click at reference frame.
Title: Re: Blinking Script
Post by: Carlos Milovic on 2010 September 27 06:46:13
:P Ok! ;)
Title: Re: Blinking Script
Post by: Carlos Milovic on 2010 December 23 08:58:23
I made a very small change to the script. Now the statistics report (series anaylisis) writes the file without empty lines. This makes data import to a spreadsheet easier.

Title: Re: Blinking Script
Post by: NKV on 2010 December 23 09:58:14
Thank you Carlos.
Title: Re: Blinking Script
Post by: Niall Saunders on 2011 January 08 06:00:24
Gents,

From the latest version of the <Animation> script - at the following point in the code (line 1110 in v2.91 from Carlos) :-

Code: [Select]
            for (var c=0; c < dest.mainView.image.numberOfChannels ; c++)
            {
               var st = new Array();
               st[0] = parent.Images[i].mainView.id;

               if (dest.mainView.image.numberOfChannels==1) {st[1]=chanelName[3];Channel[3]=true;}
               else {st[1]=chanelName[c]; Channel[c]=true;};

               st[2] = String(parent.Images[i].exposure);
               st[3] = Number(r*s[i][c].mean).toFixed(n);
               st[4] = Number(r*s[i][c].median).toFixed(n);
               st[5] = Number(r*s[i][c].avgDev).toFixed(n);
               st[6] = Number(r*s[i][c].stdDev).toFixed(n);
               st[7] = Number(r*s[i][c].minimum).toFixed(n);
               st[8] = Number(r*s[i][c].maximum).toFixed(n);
               j++;
               stat[j]=st;

               for (var k=0; k < st.length; k++)
               {
                  if (hl[k] < String(st[k]).length) hl[k] = String(st[k]).length;
               }
            }

How can the script be modified to include extra information from the FITS Header?

Specifically, my new QHY10 imager provides a "Temperature" parameter, and I would like to be able to include that in the series analysis extraction.

I can see that the basic format is st[2] = String(parent.Images[j].exposure), but (as usual) I can't find out what alternatives there are for .exposure :'(

Any suggestions?

Nikolai, I can envisage an upgraded script that provides a further dialogue box, where all of the available FITS Header parameters are presented to the user, and a check-box option is provided to allow users to select those data elements required.

Sorry, but you know me - I am always looking for 'something more' (I still have beer available, and Jedi Cookies ::))
Title: Re: Blinking Script
Post by: Carlos Milovic on 2011 January 12 08:44:54
Hi Niall
I did a quick inspection of the code, and the JS classes, but I can't find where the .exposure property came from! So I cannot help you there :P sorry.
(Oh how I love C++...)
Title: Re: Blinking Script
Post by: Niall Saunders on 2011 January 12 15:40:08
What? Two Jedii - and neither of us know the answer?

I feel we ought to hand back the cookies Carlos :'(
Title: Re: Blinking Script
Post by: NKV on 2011 January 12 18:16:25
I did a quick inspection of the code, and the JS classes, but I can't find where the .exposure property came from!
JS ImageWindow.Properties.exposure
Also i see ImageWindow.Properties.keywords and i hope it's FITS keywords.
 ;)
Title: Re: Blinking Script
Post by: Carlos Milovic on 2011 January 12 20:39:11
Seems to... its an array.

Also, from ImageWindow.h (PCL, c++):
Code: [Select]
   /*!
      Obtains a copy of the %FITS header keywords currently defined for the
      image in this window. Returns true if this image has %FITS keywords.

      \param[out] kwds     Reference to a container that will receive a copy of
                           the %FITS keywords defined in this image.

      \sa SetKeywords(), ResetKeywords()
   */
   bool GetKeywords( FITSKeywordArray& kwds ) const;

So, I would say that it is highly likely that it contains the fits keywords, if they have been loaded.
Title: Re: Blinking Script
Post by: Niall Saunders on 2011 January 12 23:47:25
Hi guys,

OK, I am a tiny step closer.

It also ocurred to me to apply the FITS Header process to an image, then to look at the History Explorer for that image. When I do that, this is the code that appears:-
Code: [Select]
// Start time: 2011/01/13 07:40:51 UTC
// Execution time: 1.280 s
var p = new FITSHeader;
with ( p )
{
   keywords = [ // name, value, comment
      ["SIMPLE", "T", "file does conform to FITS standard"],
      ["BITPIX", "16", "number of bits per data pixel"],
      ["NAXIS", "2", "number of data axes"],
      ["NAXIS1", "2612", "length of data axis 1"],
      ["NAXIS2", "3896", "length of data axis 2"],
      ["EXTEND", "T", "FITS dataset may contain extensions"],
      ["COMMENT", "", "FITS (Flexible Image Transport System) format defined in Astronomy and"],
      ["COMMENT", "", "Astrophysics Supplement Series v44/p363, v44/p371, v73/p359, v73/p365."],
      ["COMMENT", "", "Contact the NASA Science Office of Standards and Technology for the"],
      ["COMMENT", "", "FITS Definition document #100 and other FITS information."], // row 10
      ["BZERO", "32768", "offset data range to that of unsigned short"],
      ["BSCALE", "1", "default scaling factor"],
      ["EXPOSURE", "600000", "Total Exposure Time[ms]"],
      ["GAIN", "'10      '", "Analog Gain"],
      ["OFFSET", "'126     '", "Analog Offset"],
      ["TIME", "'00:23:45'", "Begin captuer time"],
      ["DATE", "'07/01/2011'", "Capture Date"],
      ["CAMERA", "'QHY10   '", "Camera model"],
      ["Temperature", "'-30.4   '", "Begin capture temperature"],
      ["Presion Time", "'0-23-45-281'", "Begin capture Presion Time"] // row 20
   ];
}

However, I still don't know how to get an extra parameter into the Animation script :'(

I am trying to get the "Temperature" information (-30.4 in the example above) to be extracted into the statistics summary file. I thought it would be easy ::)
Title: Re: Blinking Script
Post by: vetenskapsman on 2011 March 20 23:25:51
Hi ... were you ever able to get the Temperature (or any other FITS Header information) extracted into the summary file?
That would be incredibly useful  8) 

I've been searching for a way to easily get FITS Header information for a batch of images (specifically EXPOSURE and
CCD-TEMP in my case) and the solution is oh so close with the Animation script.

-carl
Title: Re: Blinking Script
Post by: NKV on 2011 April 14 05:16:35
Carlos, your ver 2.91 based on ver 2.8 :P
Thank Yuriy Toropin for attention.
Latest (including Carlos modification) version 2.92 in attachment. Deleted. New version below.
Title: Re: Blinking Script
Post by: Carlos Milovic on 2011 April 14 07:33:58
jo :P

By the way, I have a suggestion for improvement: could add an option to change the image that is displayed in the control? Also the rescalation in it is sometimes weird (not in the sense that it is wrong, but that some images are better represented as they were stored). Could you just use the same SFT settings as with the animation itself?
Title: Re: Blinking Script
Post by: NKV on 2011 April 15 00:28:28
Could you just use the same SFT settings as with the animation itself?
You mean STF ? Done. See ver 2.93 in attachment  :)
Use autoSTF, autoHT, LinkRGB, ResetSTF&HT buttons to assign current image to control window.

But, i am going crazy... because i cant understand why code in line 968:
Code: [Select]
console.writeln("this.AutoSTF_Button dest.mainView.image.isColor ",dest.mainView.image.isColor);
         preview.assign(dest.mainView.image); //asign courent image to preview image
console.writeln("this.AutoSTF_Button preview.isColor ",preview.isColor);
give strange result:
Code: [Select]
this.AutoSTF_Button dest.mainView.image.isColor true
this.AutoSTF_Button preview.isColor false

But, same code in line 1028 working good:
Code: [Select]
this.AutoHT_Button dest.mainView.image.isColor true
this.AutoHT_Button preview.isColor true

Any idea ?
Title: Re: Blinking Script
Post by: Niall Saunders on 2011 April 15 04:17:23
Hi Nikolai,

I understand that you are currently working on other issues with the Animation script at the moment, but did you ever get a chance to look at the question I raised a few months ago (concerning the ability to include other FITS header information in the Summary Details listing and file output)?

How did you manage to 'find' the method for including the FITS data that you already include?

Juan - is there any way that you can help here? Nikolai's script is a wonderful tool, but has scope for improvement (as is always the case  :P)

My final (for the moment) 'wish' would be to be able to 'graph' the summary information without having to resort to the likes of MS Excel - have you ever thought about this as a task Nikolai (or anyone else for that matter)?
Title: Re: Blinking Script
Post by: georg.viehoever on 2011 April 15 04:26:56
...My final (for the moment) 'wish' would be to be able to 'graph' the summary information without having to resort to the likes of MS Excel - have you ever thought about this as a task Nikolai (or anyone else for that matter)?

Hi Niall,

I described my idea how table views might be integrated into PI in http://pixinsight.com/forum/index.php?topic=2306.0 . Other applications I know do it this way, and I like it.

Georg
Title: Re: Blinking Script
Post by: NKV on 2011 April 15 04:27:26
Hello Niall,
I hope to add FITSKeyword data during next week.
Title: Re: Blinking Script
Post by: Carlos Milovic on 2011 April 15 07:52:32
That was fast :)
Good job. By the way, I'm trying to write a module that overlaps with your script in a significant way.
I'm not trying to create an animation but manipulate a image window to show any slice of a data cube (array of images). At a first step, this should work only for orthogonal slices, but in the future it should proyect any slice. Maybe it is not too useful for astronomical purposes, but is highly applied to biomedical imaging (microcoscopy, CT scans, MRI, etc). If you want to join the project, you'll be highly wellcome :D I'll post a first release (not much more than a draft) in a few days.
Title: Re: Blinking Script
Post by: NKV on 2011 April 17 07:39:24
Carlos,
If you want to join the project, you'll be highly wellcome
Why not? I will happy improve your project (if i can) and my programing skill.

Niall,
include other FITS header information in the Summary Details listing and file output
done. :)

Ver 2.93beta(sorry... literal version enumeration don't work in PI  ;) ) 2.94 in attachment.

PS Note: you can mix different images(size, extension, with and w/o fits header and with different header length ) in report. I can write more about the curent ver improvements, but better push me if you have trouble or you know how to improve it.

PS2: Ver 2.94 compatible with PI up to 1.6.9 ver. For PI ver 1.7.0 and up see bellow.


Title: Re: Blinking Script
Post by: Niall Saunders on 2011 April 18 23:49:32
Hi Nikolai,

First impressions of v2.94 are very good - not only have you included the single FOTS header item that I was after, but you have also created an 'options' panel that allows anyone to include 'any' of the FITS data that they need.

In fact, you have even provided the 'building blocks' for an 'automatic sequential renaming' script that I currently still have to turn outside of PixInsight to be able to achieve. (I use 'Sequentialise' by Polybytes - free - but seemingly no longer available - which is a shame, because it really was excellent at doing its job)

I will play with 2.94 as time allows, and will get back to you (heck, who knows, I might even find time to upgrade PixInsight from 01.06.01.0625 - but that means I need to shut down the copy that has been running for over three months now - and THAT means saving all those hundreds of little PI Process Icons that I have been working with on all those dozens of images, on all those multiple Workspaces. Who says PI is 'unstable' ;) ?)
Title: Re: Blinking Script
Post by: NKV on 2011 April 19 05:14:30
In fact, you have even provided the 'building blocks' for an 'automatic sequential renaming' script
This one much better: FITSKeyword sequential utility  (http://pixinsight.com/forum/index.php?topic=2997)  :)
I hope...
Title: Re: Blinking Script
Post by: NKV on 2011 May 30 21:23:08
CTRL key in PI 1.7.0 have other code.
Code: [Select]
//case "-268435454": //Ctrl PI ver 1.6.9
case "1879048194": //Ctrl PI ver 1.7.0

So ver 2.95 compatible with PI 1.7.0 in attachment.


Title: Re: Blinking Script
Post by: Juan Conejero on 2011 May 31 00:53:43
Hi Nikolay,

If you don't mind, I'm going to publish an update with this new version. Also, do you want me to publish FITSKeyword also as an update? (I overlooked this script for the final PI 1.7 release...  :-[)
Title: Re: Blinking Script
Post by: NKV on 2011 May 31 03:00:11
Yes, do it!
Title: Re: Blinking Script
Post by: mmirot on 2011 July 19 18:33:46
Ok

 Now can we add the Dynamic PSF function to it?

Max

Title: Re: Blinking Script
Post by: NKV on 2011 November 10 11:15:29
New version here PCL: Blink module (http://pixinsight.com/forum/index.php?topic=3604.0).
Title: Re: Blinking Script
Post by: NKV on 2012 January 26 00:54:53
Ver 2.96 in attachment
BugFix for Check-mark invert.

Best regards,
Nikolay.