### Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

### Topics - Juan Conejero

Pages: [1] 2 3 ... 18
1
« on: 2013 May 20 10:15:35 »

2
« on: 2013 May 20 09:03:02 »

3
##### Release Information / Comparison of noise reduction algorithms: The double gradient synthetic image
« on: 2013 May 17 20:10:43 »
Hi all,

Since we are discussing on noise reduction, let me put a more formal example to compare all the noise reduction algorithms that we have implemented in PixInsight. This time I'm going to use a well-known difficult problem: the double gradient synthetic image.

The double gradient consists of two concentric squares filled with opposite linear gradients. It can be generated very easily in PixInsight with the following PixelMath expression, executed globally to generate a new image, or locally on an image of the desired dimensions:

iif( X() < 0.25 || X() > 0.75 || Y() < 0.25 || Y() > 0.75, X(), 1 - 2*(X() - 0.25) )

When synthetic noise is added to this image, the result is an ill-posed problem for noise reduction, and is particularly well suited to show the weaknesses---and comparatively, the strong points---of different noise reduction algorithms. Here is the double gradient with a 25% of uniform noise added with the NoiseGenerator tool in PixInsight. This is the initial image that I have used in this test:

I have tried all the noise reduction tools available on the PixInsight platform, trying to do my best by fine tuning parameters to achieve the best possible result in each case. Here are the denoised images, enlarged 2:1 without interpolation:

TGVDenoise

ACDNR

MultiscaleMedianTransform

GREYCstoration

ATrousWaveletTransform

And here is my interpretation of these results:

* TGVDenoise is the absolute winner. It has been able to recover the original gradients almost perfectly with minimal generation of artifacts. Its superior result is clear and admits no discussion.

* ACDNR has been a nice surprise for me. I designed and implemented the ACDNR algorithm back in 2005. I know its weak points very well (it has many), but honestly, this result has been kind like a good old friend shouting "hey, I'm still here!" in my face

* The multiscale median transform (MMT) is a powerful tool for denoising and ringing-free sharpening of linear and nonlinear images, as we have demonstrated many times (see for example here and here), but it has two main limitations: Our implementation of MMT is not particularly good at reproducing sharp corners because it uses circular structuring elements to preserve isotropy, and median filters are not very good at reproducing smooth gradients. The next generation of MMT that we'll implement during the 1.8 cycle combines the à trous wavelet transform for smooth regions and the MMT for significant structures, taking the best from each algorithm, so it will pass this test much better.

* The GREYCstoration algorithm yields a decent result, but it generates significant artifacts around the edges of the inner square (also at the right border of the image), and does not remove the noise on smooth regions as efficiently as the preceding tools. I spent a long time trying to improve this result, but this is the best one I was able to achieve. Perhaps somebody with more practice (I admit I don't use this tool very often) would be able to get something better.

* The à trous (with holes) wavelet transform, also known as starlet transform recently, is a fundamental processing workhorse of great efficiency where isotropy and smoothness are two characteristic properties of the data, as happens with most deep-sky astronomical images. The inability of ATWT to isolate strong small-scale structures---something that MMT can do much better---becomes evident in the double gradient problem: When enough wavelet coefficients are removed to yield a smooth result, the edges of the inner square cannot be preserved because they penetrate the whole transform as a gun shot.

I have uploaded a PixInsight project that you can use to reproduce these results. If you manage to improve what I have done with some of the algorithms tested here, please let me know and post your parameters here.

4
##### Release Information / TGVDenoise Example: Gamma Cygni Region
« on: 2013 May 16 18:26:46 »
Philippe Bernhard has kindly uploaded a set of six linear images for us to test TGVDenoise out. In this first example I'm going to show how easily we can achieve a very good noise reduction when the data are excellent.

The original image is an integration of 20 light frames of the Gamma Cygni region:

The six images that Philippe has uploaded are of excellent quality, as you'll see in the next screenshots. This is the linear output of the ImageIntegration process, so we need ScreenTransferFunction (STF) in order to see the image on the screen. For newbie users, the STF tool in PixInsight applies a histogram transformation to the data that are sent to the screen, but does not change the actual image. This way we can work with linear images without stretching them. This is very important because data linearity is necessary for some essential image processing algorithms and techniques, such as color calibration, background modeling and deconvolution. There are also some tools that can be applied to both linear and nonlinear images, but perform much better with linear data.

For noise reduction of linear images, it is very important to carefully adjust STF settings, so that we can see the background, and at the same time, bright areas without saturation. Usually the automatic STF stretch is too aggressive for this purpose. The next screenshot shows the original image enlarged 4:1 with the custom STF that I've used in this example.

And without more preambles, this is the same area after TGVDenoise:

As you probably have already discovered if you have tried out this tool, the default TGVDenoise parameters have been optimized for nonlinear images. For linear images, the default parameters are way too aggressive, and usually have to be lowered by one order of magnitude or even more.

Something that will cause some surprise is the fact that I haven't used a local support in this example. This will give you a better idea of the power of TGVDenoise: For images with relatively high SNR, this tool is able to remove virtually all of the noise, preserving significant structures remarkably well without any help from external data.

Once you get some experience with the tool, finding the correct parameters becomes very easy, especially for high-quality data. It has taken me about five minutes to achieve the noise reduction that I was looking for with this image. I'll show you the result on two additional previews for comparison.

Original image:

After TGVDenoise:

Original image:

After TGVDenoise:

And as usual, some crops of special interest zoomed 3:1 (left: original image, right: after TGVDenoise).

Now this image can be printed at a size of 1 meter by 80 cm at 300 dpi without problems (about 40 x 30 inches), and navigating through it onscreen zoomed 4x is a real joy.

Thank you Philippe for allowing me to work with your nice data.

5
##### Release Information / TGVDenoise Example: Noise Reduction in CIE Lab Mode
« on: 2013 May 14 18:08:09 »
Hi all,

As promised, here is a first noise reduction example with the new TGVDenoise tool. To show a complete workflow with color data, I have chosen an image that poses a relatively difficult problem for noise reduction. It is a Canon EOS 7D raw image that has already been stretched and saturated with the HistogramTransformation and CurvesTransformation tools in PixInsight.

A strong color saturation curve has been applied directly after the initial stretch, which has been an obvious mistake: A side effect of this uncontrolled color saturation boost is generation of severe noise in the chrominance. We know that color saturation enhancements must be applied with some control (with protection masks, and/or after noise reduction, etc.), in order to prevent chrominance noise intensification. But this is just an example, where I have taken the liberty to make some things difficult on purpose.

The resulting image is an interesting noise reduction problem, mainly due to the following factors:

(1) Severe chrominance noise, for the reasons explained above.

(2) Fine details at scales dominated by the noise.

(3) Low-contrast structures that can be problematic for edge protection.

(4) Extended background areas with strong noise and no significant detail.

Reason (1) is why we have implemented a special CIE Lab working mode in the TGVDenoise tool. When the noise is very different (in its distribution and intensity) for the lightness and chroma components, applying two separate noise reductions seems the most logical option. Reasons (2) and (3), and the fact that they are plainly opposite to (4), suggest the need for a local support image to drive the TGV regularization algorithm.

As usual, we'll work on a small preview covering a region of special interest. Recall that as long as we don't enable its automatic convergence parameter, TGVDenoise is a fully previewable process, so what we'll get on the preview will be consistent with the result obtained on the whole image.

The screenshot above will give you an idea of the severity of the noise in our working image, especially color noise.

Our first step is building a local support image. By default, the TGVDenoise tool uses the intensity component (in the HSI system) of the target image. In this case, however, I prefer to work with the lightness component because it is much less noisy than intensity, due to the color noise problems that I have described. So we'll extract lightness (IMAGE > Extract > Lightness) as a new image and select it as a local support on the TGVDenoise tool.

Recall that a local support is intended to represent the signal-to-noise ratio of the target image, with the purpose of conditioning the TGV noise reduction algorithm. So where the local support image is white we are saying 'this is signal, look but don't touch!', and where the support is black we say 'this is trash, remove it please'. To improve the support in this sense, we have several histogram controls. I have used the midtones balance and shadows clipping parameters to increase contrast, as shown in the next screenshot:

I have also removed the first wavelet layer to make the support slightly less noisy, and hence more accurate. Note that this does not alter the support image in any way; the transformations are applied to an internal working duplicate, never to the selected image.

On the screenshot above, note that I have selected the Preview mode in the Local Support section. In this mode, TGVDenoise replaces the target image with a copy of its internal working support image, which is useful to control the support. We have to disable this mode to perform an actual noise reduction procedure.

As I have said at the beginning of this post, we'll work in the CIE Lab color mode of TGVDenoise in this example. We'll start with lightness noise reduction, so we'll disable chrominance parameters and select the Lightness display mode for the target image. In this way we can concentrate on the lightness, without wasting time processing the chrominance components. This allows us to save a 67% of processing time during our initial testing steps.

After some trial-error work, this is my processed lightness:

Let's repeat the same procedure for the chrominance. Disable lightness parameters and select the "a=R b=G" display mode:

In this mode, the red and green channels show a representation of the CIE a* and CIE b* chrominance components, respectively. This allows you to visualize the color components of the image independently from lightness, that is, what you see on the screen is a special rendition of pure color contents. This mode is especially handy for noise reduction, as you can see in these screenshots. Below is my final processed chrominance.

Note that the chrominance parameters are much more aggressive than the lightness parameters. As you know, the human vision system is rather poor at detecting details defined by color variations. Most of the detail we perceive in an image comes from lightness variations. Thanks to this property of our vision, we usually can apply a comparatively strong noise reduction to the chrominance without damaging the perceived detail. In this example, I have used an edge protection parameter value that is about one order of magnitude larger for chrominance than for lightness.

This is my final denoised image:

For better evaluation of the result, let's take a closer look at some regions of particular interest. Below are three crops of 200x200 pixels enlarged 3:1 without interpolation; original versus processed image.

The result is very good in my opinion, especially considering the severity of the noise in the original image. It is not perfect, of course, and we can easily find positive and negative aspects. For example, some low-contrast structures have been damaged in the green stem of the third crop, and we can find a number of small details that have lost some of their initial color support. On the other hand, low-contrast features have been preserved remarkably well on the shadowed yellow areas of the second crop, and the spider webs have been protected extremely well over a smooth background on the first crop. Overall, this kind of result is very difficult to achieve, if not impossible, with other noise reduction tools that we have implemented in PixInsight. More examples to come.

6
##### Release Information / TGVDenoise 1.0 Released
« on: 2013 May 13 19:00:50 »
Hi everybody,

I am proud to announce that we have just released a new tool: TGVDenoise, written by PTeam member Carlos Milovic. All users have now access to this tool as a regular update to PixInsight 1.8.0 RC7.

TGVDenoise is a noise reduction tool based on total generalized variation (see references [1...5] at the end of this post), a novel signal processing concept with important applications to image regularization and restoration. As I anticipated in a previous post, TGVDenoise is the first one of a series of TGV-based tools that we have been working on during the last year. Other members of this series are a multiscale, spatially adaptive TGV noise reduction tool (SATGV), and an image restoration (deconvolution) tool. Hopefully we'll be releasing these modules during the next weeks and months. I would like to reiterate my congratulations to Carlos Milovic for his excellent research and development work on these tools.

In the rest of this post I'll describe briefly the main TGVDenoise parameters. We'll be posting noise reduction examples on this board during the next days.

Overview of the TGVDenoise tool

The TGVDenoise tool has two separate sections: noise reduction parameters at the top side, and local support parameters at the bottom side. While we write an official documentation, let's describe briefly these sections and their corresponding parameters.

Noise Reduction Parameters

* Color working mode.

For color images, TGVDenoise provides two working modes: RGB/K and CIE L*a*b*. In RGB/K mode, the same set of parameters is applied to each nominal RGB channel, for color images, or to the nominal grayscale channel, for monochrome images. Note that for grayscale images the color working mode is irrelevant.

In CIE L*a*b* mode, the target image is first converted to the CIE L*a*b* color space. Lightness parameters (first tab) are then applied to the CIE L* component, and chrominance parameters (second tab) are applied to the CIE a* and b* components. Finally, the image is converted back to the RGB space. This mode allows you to apply a different (usually more aggressive) noise reduction procedure to the chrominance, which makes the tool more flexible and adaptable to a variety of typical denoising problems. You can disable one of the parameter sets, so you can apply noise reduction just to either the lightness or chroma components.

* Strength

This parameter controls the strength of the diffusion process that smoothens the image. Large values are more aggressive, while small values tend to give results that are more similar to the original image. You have to find a good balance between the strength and edge protection parameters (see below).

* Edge protection

This is by far the most critical parameter of the TGVDenoise tool. This parameter works as a threshold for the regularization process, preventing diffusion over edge features stronger than the threshold value. Hence, you use this parameter to prevent the noise reduction process from damaging significant image detail and features. Smaller values are more aggressive to protect edges against blurring caused by the diffusion process. Larger values are more permissive and lead to smoother images, but may cause some detail loss.

* Smoothness

Controls the continuity degree of smooth regions. Smaller values tend to preserve small-scale structures such as sharp edges, but also may generate staircase artifacts. The default value of 2 usually works well with most images, and you normally won't need to change it.

* Iterations

TGVDenoise emulates a diffusion process, following a dynamic evolution scheme. Each iteration can be seen as a time sample, where the image reaches a new state. The process converges to an optimal solution when no significant diffusion can happen between neighbor pixels. This usually requires a large number of iterations. Convergence is evaluated by calculating the norm of the difference between two consecutive iteration steps. This is an estimate of global error, or mean square change. Usually, once this difference drops below 1/255, little or no changes can be perceived in the displayed image.

Upon execution, TGVDenoise writes its final global error estimate to the console as a 'delta' value. You can watch these estimates to get an idea of how well the process is converging to an acceptable result. The default value of the iterations parameter (100 iterations) is a good starting point for most images.

* Automatic convergence

When automatic convergence is enabled, the process will be stopped if either the difference between two successive iterations (see the iterations parameter above) is smaller than the convergence parameter (see below), or if the maximum number of iterations is reached; whichever happens first. If this parameter is disabled, the specified number of iterations will always be performed, ignoring the convergence parameter.

Be aware that when automatic convergence is enabled, the TGVDenoise process is not previewable. In other words, since convergence is specific to the data being processed, there is no guarantee that the result obtained on a preview be the same as the result obtained on its mother image with the same parameters. Depending on the image, the differences can be significant. For this reason the automatic convergence parameter is disabled by default.

* Convergence

When automatic convergence is enabled, the TGVDenoise process will be stopped when the difference between two successive iterations becomes smaller than this value. See the information given for the iterations and automatic convergence parameters.

Local Support Parameters

A local support image changes the rate of the diffusion process, creating a spatially dependent function. This allows to better preserve high SNR areas, or to protect specific image edges. For deep-sky astronomical images, a local support is advisable to achieve optimal results, especially for linear images.

It is very important to point out that the local support image is not a mask. The support image should represent the signal-to-noise ratio of the target image, where higher pixel values will provide stronger protection. This effectively controls the dynamic properties and evolution of the TGV regularization process, but does not work by mixing processed and unprocessed pixels, so it has nothing to do with a mask. Of course, the TGVDenoise process is fully maskable, so you can apply it through a mask if you find it necessary, in addition to using (or not) a local support image.

* Preview

Enable this option to get a preview of the working local support image that will be used by TGVDenoise. This is a control mode that must be disabled to perform an actual noise reduction process.

* Support image

By default, the local support image is disabled. TGVDenoise performs outstandingly well for most images without the help of a local support. When enabled, the local support is the intensity component (in the HSI color system) of the target image by default, but you can select any grayscale image with the same geometry as the target view (or its mother image in the case of a preview). When SNR is proportional to illumination, as happens with deep-sky images, a local support can be of great help to drive the TGVDenoise process, as noted above.

* Noise Reduction

This is the number of small-scale wavelet layers that will be removed from the working local support image. For very noisy images, smoothing the local support may help to achieve more accurate results because this makes it less dependent on spurious small-scale variations.

* Midtones

This is the midtones balance parameter of a histogram transformation that will be applied to the working local support image. Use it to fine tune protection on moderately bright areas.

This is the shadows clipping point parameter of a histogram transformation that will be applied to the working local support image. Increase it to decrease protection on dark areas.

* Highlights

This is the highlights clipping point parameter of a histogram transformation that will be applied to the working local support image. Decrease it to increase protection on bright areas.

Important Notes

* TGVDenoise is a memory intensive process. Internally it requires 13 working duplicates of one channel of the target image in 32-bit floating point format, so it may easily cause out-of-memory errors on the 32-bit version of PixInsight for Windows. If this happens to you, the only solution is a 64-bit version of PixInsight running on a 64-bit operating system.

* TGVDenoise is processor-intensive. We have done our best to achieve the best optimized parallel implementation we are capable of, but despite this, the algorithm requires significant processing time for moderately large images. Since the process is fully previewable (please note: if the automatic convergence parameter is disabled), you should use relatively small previews defined on special interest areas of the image to find an optimal set of parameters, which you can apply to the whole image after testing them thoroughly.

* The strength, edge protection and smoothness parameters have been implemented as exponential controls on the TGVDenoise interface. We have already used exponential controls in the AdaptiveStretch tool. These controls allow you to work in scientific notation, which gives you quick and easier control for parameters with very large ranges. Each parameter is divided into four fields that work in tandem: a large edit field where you can enter the parameter's value directly, a small edit field to enter the coefficient in the range from 1 to 9.99, a slider to change the coefficient value with the mouse, and a spin box where you can define the exponent. In future versions of the TGVDenoise tool, most of these parameters will probably be implemented differently, once we improve our knowledge of their practical ranges.

References

[1] Florian Knoll, Kristian Bredies, Thomas Pock and Rudolf Stollberger. Second order total generalized variation (TGV) for MRI. Magnetic Resonance in Medicine 65(2):480-491, 2011.

[2] Kristian Bredies, Karl Kunisch and Thomas Pock. Total generalized variation. SIAM Journal on Imaging Sciences, 3(3):492-526, 2010.

[3] Kristian Bredies. Recovering piecewise smooth multichannel images by minimization of convex functionals with total generalized variation penalty. Submitted for publication, 2012.

[4] Kristian Bredies, Yiqiu Dong and Michael Hintermüller. Spatially dependent regularization parameter selection in total generalized variation models for image restoration. Submitted for publication, 2012.

[5] Chambolle, A., Pock, T. A first-order primal-dual algorithm for convex problems with applications to imaging. J. Math. Imaging Vis. 40, 120–145, 2011.

7
##### Release Information / TGVDenoise - Preliminary test results
« on: 2013 May 04 01:16:19 »
Hi all,

As you probably know, we are currently working on new tools that will be included in the final 1.8.0 release of PixInsight. Some of these tools implement techniques based on total generalized variation. After the intense research and development work done by Carlos Milovic during the last year, we have now a first working tool in the testing/optimization phase: TGVDenoise.

As its name suggests, TGVDenoise is a noise reduction tool based on total generalized variation regularization. Today we have made some 'formal' tests with TGVDenoise, which we want to share with you on this post. The subject of the first test is the well-known Lena picture. This is the original 512x512 grayscale lena.png image:

And this is the same image processed with the new TGVDenoise tool:

Note that the TGVDenoise tool has been applied directly to the original image without any mask. I suggest you download both images and compare them at 4:1 zoom or more.  Lena is a tough subject for noise reduction because it provides a compendium of the most difficult problems for this task: fine details, large areas covered by smooth gradients, and small-scale, low-contrast structures. Here is a selection of some interesting areas for comparison, enlarged 4:1 without interpolation:

Looks promising indeed. It is important to point out that this tool works equally well with linear and nonlinear images. Now we have a lot of work ahead to improve and optimize our implementation, but you can count on a new weapon in our noise reduction arsenal. Kudos to Carlos Milovic for his excellent work.

8
##### Release Information / New automatic FITS header cleanup feature
« on: 2013 April 30 14:43:54 »
Hi all,

I have just released an update with version 1.0.14 of the FITS format support module for PixInsight 1.8.0. This version comes with a new cleanup headers feature.

The FITS standard allows only printable ASCII characters in header keywords (ISO/IEC 8859-1 code points from 2016 to 7E16). Unfortunately, some applications ignore this rule and write illegal characters to FITS keyword comments and values. For example, the degree sign, whose code is B016 (decimal 176), is written by some applications to represent temperatures and angles in FITS keyword comments. Other common cases are copyright signs (A916 = 16910) and Latin characters with graves, acutes, dieresis, etc., in user names (SWOWNER keywords). For the sake of compatibility, PixInsight has always loaded these nonstandard FITS files without problems, but we'll never allow writing them unless the illegal characters are either removed or replaced with legal ASCII values. Our policy is to never contribute to propagate or distribute nonstandard files in any format.

Users of software applications that generate nonstandard FITS files for the reason described above have always had problems to save their images in standards-compliant applications such as PixInsight. The only solution to these problems is to edit or replace the wrong headers, and so far this had to be done either manually or using batch tasks implemented as scripts or with the ImageContainer and FITSHeader tools. These issues have been recurring, and it seems that the applications causing them have no intention to fix them, after many years. Hence, we have decided to implement a new feature to repair wrong headers automatically in PixInsight.

The new cleanup headers option is available from the FITS Format Preferences dialog:

If this option is enabled, any illegal characters in the header keywords of a FITS file will be replaced automatically by their best legal counterparts before writing the file to disk. For example, an illegal character C016 (Latin capital letter A with grave = À) will be replaced by 4116, or a Latin capital letter A. Similarly, an illegal copyright sign (A916 = ©) will be replaced by the standard three-character sequence "(C)". Note that the cleanup headers option is disabled by default. This has been done on purpose because we don't want nonstandard FITS files to pass inadverted.

The cleanup headers FITS feature can also be controlled using the "cleanup-headers" and "no-cleanup-headers" format hints to override current module settings by enabling and disabling, respectively, the cleanup headers option. For example, the following screenshot shows how to use the BatchFormatConversion script to fix a set of FITS files:

The same output hint can be used directly in tools such as ImageCalibration and StarAlignment.

9
##### Announcements / PixInsight 1.8.0 RC7 "Ripley" Released
« on: 2013 April 26 18:36:29 »
Hi everybody,

I am glad to announce that a new version of PixInsight has been just released and is now available to all users: 1.8.0.1015 RC7 Ripley for Linux, Mac OS X, and Windows.

PixInsight 1.8.0 RC7 is a bugfix release, which we encourage you to install as soon as possible. It fixes several important bugs and issues in previous versions --- see the Bug Fixes section below.

Special thanks to all forum members who have helped me to find and understand the problems we have had in previous release candidate versions. Solving some recent stability issues has been very hard and has put me to the test, both as a developer and as a person. I hope this version is stable for all users on all platforms.

Important for Mac OS X users: This version is compatible with Mac OS X 10.6 (Snow Leopard). You'll find specific installation packages tagged as "macosx10.6" on the software distribution site.

For your convenience, installation packages are also available on the Endor file server, on the "1.8.0-RC7" folder under the Forum Shared Files repository.

How to Install the Release

This version is not available through our automatic updates system. You have to download the appropriate installation package for your platform from our Software Distribution System:

https://pixinsight.com/dist/

Simply uninstall your current version and install the new one:

* On Windows Vista and Windows 7, select Start > All Programs > PixInsight Platform > Uninstall. Run the installation package for version 1.8.0.1015 to install it on your computer.

* On Windows 8, uninstall the PixInsight application by right-clicking it from your Start screen, or from the All Apps panel. Run the installation package for version 1.8.0.1015 to install it on your computer.

* On Linux, remove the directory where you have installed a previous version of PixInsight and uncompress the new tar.gz archive on a new directory.

* On Mac OS X, remove the previous PixInsight application bundle and uncompress the new one on your /Applications folder.

Bug Fixes

This is a partial list with the most important bugs fixed in PixInsight 1.8.0 RC7:

* Fixed a bug where closing a modified image view could lead to a crash. This bug has been particularly problematic on Mac OS X.

* Fixed a bug where resizing an image window manually (e.g. with the mouse) could lead to access violation errors under certain conditions.

* Fixed a bug where calling the ImageWindow.forceClose() method from a JavaScript script could lead to an access violation error under certain conditions, only on 64-bit Windows versions of PixInsight.

* Fixed a bug where saving a text file from the Script Editor window would raise a 'file has been modified by an external process' warning message on Mac OS X.

* Fixed a bug that was causing JavaScript context initialization failures upon application startup on 32-bit Windows versions of PixInsight.

* Fixed a bug where invalid interpolation algorithms and/or interpolation filters could be selected by the DynamicCrop tool under certain conditions, leading to distorted cropped images.

* Fixed a bug that was causing printer initialization errors upon application termination on Mac OS X.

* Fixed a performance regression that was causing too slow icon dragging operations on Mac OS X.

* Fixed several screen rendition bugs on Mac OS X.

* New version compatible with Mac OS X 10.6 (Snow Leopard).

Thank you for your patience and support. Enjoy!

10
##### Announcements / PI 1.8.0 RC6 Preview
« on: 2013 April 17 18:53:44 »
Hi all,

I am now uploading installation packages for PixInsight 1.8.0 RC6 (commercial version only) to the Endor file server:

http://endor.uv.es/

They are on the "Forum Shared Files" repository, under the "1.8.0-RC6" folder. I've just uploaded a Mac OS X package, and I'm starting to build a Windows package right now.

I'd appreciate if you can test this new version, since I want to be sure it is fully stable on all platforms before making an official release. If you don't have an account on the Endor server, you can request one by writing us from our contact form, or directly to our support email address.

This version comes with important new features; some of them are:

- Integration of the SpiderMonkey 17 JavaScript engine (this is the same engine that was included in Firefox 17; about 10% faster, more stable and with more language features).

- Improved touch event support on image windows (track pads, touch screens):
* Pinch gestures: touch with two fingers on an image and pinch to zoom in/out.
* Pan gestures: press the spacebar key, touch and swipe with one finger to pan the view.

- Improved mouse wheel support on Mac OS X.

- Masked images are now highlighted with special view selector colors.

- Improved (completely rewritten, actually) Image core JavaScript object with image iterators (two times faster pixel access; I'll describe this on the development forum boards) and new methods (Image.multiscaleMedianTransform() is one of them).

- New versions of the ImageSolver, AnnotateImage and AperturePhotometry scripts by Andrés del Pozo. The solver script can now correct for arbitrary distortions, which makes it much more accurate than previous versions.

- Many bug fixes and stability improvements.

11
##### Bug Reports / [1.8.0 RC5] Stability Problems Solved
« on: 2013 April 09 11:05:58 »
Hi everybody,

In first place, thank you so much for helping me with this issue. It seems that I have managed to identify and fix this insane "crashing closing windows" problem.

Two repeatable instances have been crucial to find the solution:

* Andrés del Pozo found a sequence of operations that invariably leads to a BEX64 crash on PI 1.8.0 RC5 for Windows:

1. Open any image
2. Open the HistogramTransformation tool
3. Activate the Real Time Preview window from the HT tool
4. Maximize the RTP Window
5. Modify any HT parameter
6. Apply HT
7. Close RTP
8. Maximize the image where HT has been applied in step 6
9. Close the image -> BEX64

For the problem to be 100% repeatable, the nine steps are necessary. Andrés uploaded a video that demonstrates the problem.

* Martin Magnan discovered the following sequence, which invariably leads to an application crash on Mac OS X with PI 1.8.0 RC5:

1. Open an image
2. Duplicate the image (or, alternatively, open a second image)
3. Open the LinearFit tool
4. Select the image from step 1 as reference image on the LF tool
5. Apply LF to the image from step 2
6. Close the image where LF has been applied in step 5 -> Application Crash

Martin also recorded a video showing the problem. This sequence shows that the LinearFit tool simply cannot be used in RC5 (probably also on RC4 and RC3). We should have discovered this before.

Finally, I have been able to reproduce the bug on both Windows and Mac OS X, on all of our development machines, following specific steps that consistently lead to the same crashes that you are experiencing. And happily, I have managed to find where the problem is, and fix it.

After the fix, not only the above sequences can be executed normally, but all the recent problems on Windows have disappeared automagically: The DarkStructureEnhance, DeconvolutionPreview and RepairedHSVSeparation scripts, as they have been distributed with RC5, work now flawlessly on Windows. There are no more BEX64 errors or access violations, or at least I have been unable to reproduce them in all cases where they were consistently reproducible before.

I'll publish an RC6 version during this week, which should be fully stable on all platforms. Thank you all for your patience and support.

12
##### Announcements / We need your help
« on: 2013 April 07 06:53:00 »
Hi everybody,

I have started this thread just to draw the attention of all forum members. I need your help to solve two open issues with PixInsight 1.8.0 RC5:

Mac OS X:

* The application crashes when an image window is closed.
* The application crashes upon exit.

http://pixinsight.com/forum/index.php?topic=5441
http://pixinsight.com/forum/index.php?topic=5259.msg37168#msg37168

Windows:

* The application crashes with a BEX64 error when an image window is closed.

http://pixinsight.com/forum/index.php?topic=5394.0

The problem is that I am unable to reproduce any of these issues with PI 1.8.0 RC5 on any machine I have access to. If I cannot reproduce a problem, I cannot understand/find/fix it.

I'm really concerned about these problems. I need your help with bug reports, crash reports (please provide as much information as possible), and both positive and negative reports, that is, I need to know also if you are not experiencing these problems.

Thank you.

13
##### PCL and PJSR Development / New SectionBar JavaScript Object
« on: 2013 April 05 21:02:18 »
Hi all,

I have just released an update for PixInsight 1.8.0 RC5 with a new standard PJSR header: SectionBar.jsh. As its name suggests, this header provides the new SectionBar JavaScript object.

SectionBar is a specialized control to manage vertically collapsible/extensible dialog sections. SectionBar provides an optional check box and a title label, in a similar way to GroupBox. SectionBar also includes a special icon that represents the current collapsed/expanded state. Basically, this object is the JavaScript counterpart to the SectionBar C++/PCL class. A number of scripts have been implementing similar controls with variations around an example code I published some time ago, so I have decided to release a standard version of this useful control.

Constructor

new SectionBar( [Control parent[, String title]] )

Creates a new SectionBar control with optional parent control and title.

Methods

Boolean SectionBar.hasCheckBox()

Returns true if the SectionBar has a check box enabled.

Boolean SectionBar.isChecked()

Returns true if the SectionBar has its check box enabled and the check box is checked.

void SectionBar.enableCheckBox()

Creates a CheckBox control at the left side of the title. When the check box is checked/unchecked, the section control is enabled/disabled. Note that the creation of a check box property cannot be undone (there's no disableCheckBox() method).

String SectionBar.title()

Returns the current title shown on the SectionBar control.

void SectionBar.setTitle( String title )

Changes the title shown on the SectionBar control.

Boolean SectionBar.hasSection()

Returns true if the SectionBar has an associated section control. By default, i.e. after a SectionBar is created, it has no associated section control.

void SectionBar.setSection( Control section )

Sets a new section control that will be associated with (and managed by) this SectionBar control.

Boolean SectionBar.isExpanded()

Returns true if the SectionBar is currently in expanded state. When a SectionBar is expanded, its associated section control (if any) is visible.

Boolean SectionBar.isCollapsed()

Returns true if the SectionBar is currently in collapsed state. When a SectionBar is collapsed, its associated section control (if any) is hidden.

void SectionBar.toggleSection()

Inverts the current collapsed/expanded state. You normally should not need to call this method directly, since SectionBar invokes it when appropriate. You can simply show or hide the associated section control directly, as SectionBar intercepts its onShow() and onHide() event handlers.

Updates the geometry of the parent dialog of this SectionBar control, according to the current collapsed/expanded state. Call this method, if necessary, after manually changing the visible state of the associated section control.

Event Handlers

To improve its flexibility, SectionBar provides also two event handlers:

SectionBar.onToggleSection( Control bar, Boolean toggleBegin )

If this event handler is defined, SectionBar calls it twice when its collapsed/expanded state changes: a first time before changing the collapsed/expanded state with toggleBegin=true, and a second time after changing the state with toggleBegin=false. The bar event argument is the SectionBar control that triggered the toggle section event.

SectionBar.onCheckSection( Control bar )

If this event is defined and the SectionBar control has its check box enabled (after calling SectionBar.enableCheckBox()), it is called when its checked state changes.

Demo Script

The best way to see how SectionBar works in practice, is through a little example script, which I have included below:

Code: [Select]
`/* * SectionBarTest.js - an example demo script for the SectionBar control. */#include <pjsr/SectionBar.jsh>function MyDialog(){   this.__base__ = Dialog;   this.__base__();   this.label = new Label( this );   this.label.useRichText = true;   this.label.text = "<p>This is Section #1. If you read this, then this section is expanded.</p>" +      "<p>Otherwise it is collapsed. If you find this information useful, then you need more coffee :)</p>";   this.textBox = new TextBox( this );   this.textBox.text = "<html><p>This is Section #2. If you read this, then this section is expanded.</p>" +      "<p>Otherwise it is collapsed. If you find this information useful, then you need more coffee :)</p></html>";   this.info = new Label( this );   this.info.minWidth = 250;   this.hSizer = new HorizontalSizer;   this.hSizer.add( this.info, 100 );   this.onToggleSection = function( bar, beginToggle )   {      if ( beginToggle )      {         this.dialog.textBox.setFixedSize();         this.dialog.setVariableSize();      }      else      {         this.dialog.textBox.setVariableSize();         if ( this.dialog.textBox.visible )            this.dialog.setVariableSize();         else            this.dialog.setFixedSize();         this.dialog.info.text = bar.title() + " has been " + (bar.isExpanded() ? "expanded" : "collapsed");      }   };   this.onCheckSection = function( bar )   {      this.dialog.info.text = bar.title() + " has been " + (bar.isChecked() ? "checked" : "unchecked");   };   this.section1 = new Control( this );   this.section1.setMinSize( 300, 200 );   this.section1.sizer = new VerticalSizer;   this.section1.sizer.add( this.label );   this.bar1 = new SectionBar( this, "Section One" );   this.bar1.setSection( this.section1 );   this.bar1.enableCheckBox();   this.bar1.onToggleSection = this.onToggleSection;   this.bar1.onCheckSection = this.onCheckSection;   this.section2 = new Control( this );   this.section2.setMinSize( 300, 200 );   this.section2.sizer = new VerticalSizer;   this.section2.sizer.add( this.textBox );   this.bar2 = new SectionBar( this, "Section Two" );   this.bar2.setSection( this.section2 );   this.bar2.onToggleSection = this.onToggleSection;   this.bar2.onCheckSection = this.onCheckSection;   this.sizer = new VerticalSizer;   this.sizer.margin = 8;   this.sizer.spacing = 4;   this.sizer.add( this.bar1 );   this.sizer.add( this.section1 );   this.sizer.add( this.bar2 );   this.sizer.add( this.section2 );   this.sizer.addSpacing( 4 );   this.sizer.add( this.hSizer );   this.section1.hide();   this.adjustToContents();   this.windowTitle = "SectionBar Test";   this.width = 600;};MyDialog.prototype = new Dialog;var d = new MyDialog;d.execute();`
As you see, using SectionBar is rather simple: Just declare it as a child of your dialog, and pass a section control by calling the SectionBar.setSection() method. After this call the section control will be managed by the SectionBar object, as you can verify by running the script above.

I urge all PJSR developers to update their scripts, as necessary, using the new standard SectionBar control. Happy coding!

14
##### PCL and PJSR Development / Gnuplot Included in PixInsight Core 1.8 Distributions
« on: 2013 April 02 15:48:31 »
Starting from PixInsight Core version 1.8.0, the gnuplot graphing utility is part of standard PixInsight Core distribution on all platforms. This means that you can execute gnuplot from a PixInsight JavaScript script or PCL/C++ module to generate custom graphics.

The version of gnuplot included with PixInsight has two main limitations. One of them is that the application has basically no user interaction capabilities. It does not have a graphical user interface, and has only limited console I/O functionality. In other words, the gnuplot program that we have in PixInsight is not intended to be accessible to the user, but to scripts and modules that use it as their graphics generation back-end.

The other limitation is that, due to dependencies on some third-party libraries, the only output format available on all platforms is Scalable Vector Graphics (SVG). PNG output is only available on X11 platforms (Linux and FreeBSD). Note that, in practice, this is not an actual limitation, since SVG is in fact the best format available for graphics generation.

Using gnuplot from a PixInsight script or module cannot be easier. These are the basic steps:

1. Write a gnuplot script, which is a plain text file. In the script, you must specify the SVG output format and the path to an output file.

2. If necessary, write a data file in a format that gnuplot can read and use.

3. Execute the gnuplot application as an external process.

4. Optionally, communicate with the gnuplot process by reading its standard output channel.

5. Load the generated SVG file and render it as a bitmap in PixInsight. The bitmap can be combined with other bitmaps or images, and can be shown on a control or as a new image window.

Let's put a little example. Along with gnuplot's reference documentation, gnuplot's website provides a large number of examples and demo scripts that one can use for testing and learning purposes. I have taken one of these demo scripts, namely a 3D representation of a Mandelbrot function, to build a step-by-step example.

This is the gnuplot script for this example:

Code: [Select]
`# Select the SVG output formatset terminal svg size 1024,768 enhanced# Set the output file name - change it if requiredset output '/tmp/mandelbrot-3d.svg'# The rest of the script has been copied from a gnuplot demo script:#    http://gnuplot.sourceforge.net/demo_4.6/surface1.25.gnuset samples 51, 51set isosamples 60, 60set hidden3d back offset 1 trianglepattern 3 undefined 1 altdiagonal bentoverset style data linesset title "Mandelbrot function"set xlabel "X axis"set xlabel  offset character -3, -2, 0 font "" textcolor lt -1 norotateset ylabel "Y axis"set ylabel  offset character 3, -2, 0 font "" textcolor lt -1 rotate by -270set zlabel "Z axis"set zlabel  offset character -5, 0, 0 font "" textcolor lt -1 norotatesinc(u,v) = sin(sqrt(u**2+v**2)) / sqrt(u**2+v**2)compl(a,b)=a*{1,0}+b*{0,1}mand(z,a,n) = n<=0 || abs(z)>100 ? 1:mand(z*z+a,a,n-1)+1GPFUN_sinc = "sinc(u,v) = sin(sqrt(u**2+v**2)) / sqrt(u**2+v**2)"xx = 6.08888888888889dx = 1.11x0 = -5x1 = -3.89111111111111x2 = -2.78222222222222x3 = -1.67333333333333x4 = -0.564444444444444x5 = 0.544444444444445x6 = 1.65333333333333x7 = 2.76222222222222x8 = 3.87111111111111x9 = 4.98xmin = -4.99xmax = 5n = 10zbase = -1GPFUN_compl = "compl(a,b)=a*{1,0}+b*{0,1}"GPFUN_mand = "mand(z,a,n) = n<=0 || abs(z)>100 ? 1:mand(z*z+a,a,n-1)+1"splot [-2:1][-1.5:1.5] mand({0,0},compl(x,y),30)`
Copy this script and paste it in a new Script Editor document. Then save it as 'mandelbrot-3d.gnu' on a directory of your choice. In my case, I have saved it to the Documents directory under my home directory (I use Linux), so the file path is: '\$HOME/Documents/mandelbrot-3d.gnu'.

Now let's test the script by running gnuplot. From the Process Console command line, enter the following on Linux and Mac OS X:

!!\$PXI_BINDIR/gnuplot \$HOME/Documents/mandelbrot-3d.gnu

where you should replace '\$HOME/Documents/mandelbrot-3d.gnuplot' with the actual file path where you have saved the script on your machine. On Windows, let's assume you've saved the script to a Documents folder under your user profile folder:

!!\$PXI_BINDIR/gnuplot.exe \$USERPROFILE/Documents/mandelbrot-3d.gnu

The two bangs (!!) in front of the command execute the gnuplot program as an independent process (a daemon on UNIX/Linux). With a single bang, gnuplot would be executed as a child process. Note that this can cause problems because the version of gnuplot included with PixInsight cannot interact with PixInsight's console, so if the script does not work, running gnuplot as a child process may lead to a crash. The PXI_BINDIR environment variable is always defined by the PixInsight Core application as its default binary installation directory, i.e. the directory where the PixInsight executable resides.

Now if everything went well, gnuplot has generated an SVG file at the location specified by the 'set output' command in the script. We can open it as a new image in PixInsight:

To execute gnuplot from PCL/C++ code, you should use the ExternalProcess class. In a similar way, you should use the ExternalProcess core JavaScript object from a PJSR/JavaScript script.

I hope this new feature will help all PixInsight developers to create better and more powerful tools. A big thanks to the gnuplot authors for releasing their wonderful work under a truly open-source license, which has allowed us to integrate it with PixInsight.

15
##### PCL and PJSR Development / New Core Icons in PixInsight 1.8
« on: 2013 April 02 11:44:18 »
Hi all,

As you surely know, the new PixInsight Core 1.8 application comes with a completely redesigned set of icons, which you can use in your scripts and modules, as usual, using Qt resource paths. For example, in JavaScript:

var btn = new ToolButton( this );
btn.icon = ":/icons/mail.png";

Note that you no longer need to instantiate Bitmap to set the icon property of a control. In previous versions of PixInsight, the above code should be written as follows:

var btn = new ToolButton( this );
btn.icon = new Bitmap( ":/icons/mail.png" );

Now you can simply assign a string to the icon property. This works with core resources as well as external resources (disk files).

The old core icons, namely all icon paths starting with ":/images/", still work because I have included a compatibility resource module in all PixInsight distributions. However, I urge all PixInsight developers to update their scripts and modules to use the new core icons. This is important to achieve a coherent look and feel on all platforms.

Attached to this post you'll find a little utility script that allows you to browse all available core icons conveniently on a dialog. Please let me know if you find any errors, and don't hesitate to ask for more icons, if you find that the existing set does not fulfill your needs.

Pages: [1] 2 3 ... 18