Author Topic: PCL: EnableRejection() && CalculateStatistics()  (Read 3862 times)

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 677
PCL: EnableRejection() && CalculateStatistics()
« on: 2012 February 14 06:38:46 »
Hi,
I try avoid unnecessary Statistics calculation in GenerateRealTimePreview route.
I can check via view.Window().MainView().AreStatisticsAvailable()
But how to check IsLowRejectionEnabled() before calling .GetStatistics( statistics_container ) ?
Or how to set EnableRejection() before calling .CalculateStatistics() ?
 
Is it possible? Especially in pcl::ProcessInterface::GenerateRealTimePreview route?

Best regards,
Nikolay.

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: PCL: EnableRejection() && CalculateStatistics()
« Reply #1 on: 2012 February 19 03:38:13 »
No, it isn't possible unfortunately. Currently view statistics are always generated in the same way by the PI Core application, that is, the whole set of statistics is computed without specific rejection limits.

What you can do to improve on this limitation is to compute statistics on your own. You could implement a cache of ImageStatistics objects (or other suitable structure you define) and maintain it for all images involved in your process. You can reimplement image notifications (ImageUpdated() and ImageDeleted() should suffice) in your interface to keep track of changes, and recompute or destroy image statistics as appropriate.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/