<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.40.0 

Copyright (C) The free-astro development team, 2019-2023

This file is part of Siril.

Siril is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Siril is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Siril.  If not, see <http://www.gnu.org/licenses/>.

-->
<interface>
  <requires lib="gtk+" version="3.22"/>
  <!-- interface-local-resource-path ../.. -->
  <!-- interface-css-provider-path siril.css -->
  <!-- interface-license-type gplv3 -->
  <!-- interface-name Siril -->
  <!-- interface-description Tool for astronomy image processing -->
  <!-- interface-copyright The free-astro development team, 2023 -->
  <object class="GtkAdjustment" id="denoise-modulation-adjustment">
    <property name="upper">1</property>
    <property name="value">1</property>
    <property name="step-increment">0.05</property>
    <property name="page-increment">0.10</property>
  </object>
  <object class="GtkAdjustment" id="denoise-rho-adjustment">
    <property name="upper">1</property>
    <property name="value">0.20</property>
    <property name="step-increment">0.01</property>
    <property name="page-increment">0.10</property>
  </object>
  <object class="GtkAdjustment" id="denoise_sos_adjustment">
    <property name="lower">1</property>
    <property name="upper">100</property>
    <property name="value">3</property>
    <property name="step-increment">1</property>
    <property name="page-increment">5</property>
  </object>
  <object class="GtkDialog" id="denoise_dialog">
    <property name="width-request">400</property>
    <property name="can-focus">False</property>
    <property name="title" translatable="yes">Image Denoising</property>
    <property name="resizable">False</property>
    <property name="type-hint">dialog</property>
    <signal name="delete-event" handler="siril_widget_hide_on_delete" swapped="no"/>
    <signal name="hide" handler="on_denoise_cancel_clicked" swapped="no"/>
    <signal name="show" handler="on_denoise_dialog_show" swapped="no"/>
    <child internal-child="vbox">
      <object class="GtkBox">
        <property name="can-focus">False</property>
        <property name="orientation">vertical</property>
        <property name="spacing">16</property>
        <child internal-child="action_area">
          <object class="GtkButtonBox">
            <property name="can-focus">False</property>
            <property name="layout-style">end</property>
            <child>
              <object class="GtkButton" id="denoise_cancel">
                <property name="label" translatable="yes">Close</property>
                <property name="visible">True</property>
                <property name="can-focus">True</property>
                <property name="receives-default">True</property>
                <property name="tooltip-text" translatable="yes">Cancel</property>
                <signal name="clicked" handler="on_denoise_cancel_clicked" swapped="no"/>
              </object>
              <packing>
                <property name="expand">True</property>
                <property name="fill">True</property>
                <property name="position">0</property>
              </packing>
            </child>
            <child>
              <object class="GtkButton" id="denoise_roi_preview">
                <property name="label" translatable="yes">ROI Preview</property>
                <property name="visible">True</property>
                <property name="can-focus">True</property>
                <property name="receives-default">True</property>
                <property name="tooltip-text" translatable="yes">Apply</property>
                <signal name="clicked" handler="on_denoise_apply_clicked" swapped="no"/>
                <style>
                  <class name="suggested-action"/>
                </style>
              </object>
              <packing>
                <property name="expand">True</property>
                <property name="fill">True</property>
                <property name="position">1</property>
              </packing>
            </child>
            <child>
              <object class="GtkButton" id="denoise_apply">
                <property name="label" translatable="yes">Apply</property>
                <property name="visible">True</property>
                <property name="can-focus">True</property>
                <property name="receives-default">True</property>
                <property name="tooltip-text" translatable="yes">Apply</property>
                <signal name="clicked" handler="on_denoise_apply_clicked" swapped="no"/>
                <style>
                  <class name="suggested-action"/>
                </style>
              </object>
              <packing>
                <property name="expand">True</property>
                <property name="fill">True</property>
                <property name="position">2</property>
              </packing>
            </child>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">False</property>
            <property name="position">0</property>
          </packing>
        </child>
        <child>
          <object class="GtkFrame">
            <property name="visible">True</property>
            <property name="can-focus">False</property>
            <property name="label-xalign">0</property>
            <property name="shadow-type">none</property>
            <child>
              <object class="GtkCheckButton" id="check_denoise_cosmetic">
                <property name="label" translatable="yes">Remove salt and pepper noise</property>
                <property name="visible">True</property>
                <property name="can-focus">True</property>
                <property name="receives-default">False</property>
                <property name="tooltip-text" translatable="yes">This option applies cosmetic correction to remove salt and pepper noise before the primary denoising algorithm. This is generally a good thing and the setting defaults to active.</property>
                <property name="halign">start</property>
                <property name="active">True</property>
                <property name="draw-indicator">True</property>
              </object>
            </child>
            <child type="label">
              <object class="GtkLabel">
                <property name="visible">True</property>
                <property name="can-focus">False</property>
                <property name="label" translatable="yes">Cosmetic Correction</property>
                <attributes>
                  <attribute name="weight" value="bold"/>
                </attributes>
              </object>
            </child>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="position">1</property>
          </packing>
        </child>
        <child>
          <object class="GtkFrame" id="denoise_artefact_control">
            <property name="visible">True</property>
            <property name="can-focus">False</property>
            <property name="label-xalign">0</property>
            <property name="shadow-type">none</property>
            <child>
              <object class="GtkCheckButton" id="check_denoise_suppress_artefacts">
                <property name="label" translatable="yes">Independent Channels</property>
                <property name="visible">True</property>
                <property name="can-focus">True</property>
                <property name="receives-default">False</property>
                <property name="tooltip-text" translatable="yes">Suppresses blocky colour artefacts that may rarely appear in colour images. This option treats each channel separately and eliminates artefacts at the cost of some speed. Most of the time this is not required, so it is off by default and should only be enabled in the rare event that you see artefacts when denoising a colour image.</property>
                <property name="halign">start</property>
                <property name="draw-indicator">True</property>
              </object>
            </child>
            <child type="label">
              <object class="GtkLabel">
                <property name="visible">True</property>
                <property name="can-focus">False</property>
                <property name="label" translatable="yes">Color Denoising</property>
                <attributes>
                  <attribute name="weight" value="bold"/>
                </attributes>
              </object>
            </child>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="position">2</property>
          </packing>
        </child>
        <child>
          <object class="GtkFrame">
            <property name="visible">True</property>
            <property name="can-focus">False</property>
            <property name="label-xalign">0</property>
            <property name="shadow-type">none</property>
            <child>
              <object class="GtkBox">
                <property name="visible">True</property>
                <property name="can-focus">False</property>
                <property name="margin-top">5</property>
                <property name="orientation">vertical</property>
                <property name="spacing">5</property>
                <child>
                  <object class="GtkRadioButton" id="radio_denoise_nosecondary">
                    <property name="label" translatable="yes">No secondary denoising stage</property>
                    <property name="visible">True</property>
                    <property name="can-focus">True</property>
                    <property name="receives-default">False</property>
                    <property name="tooltip-text" translatable="yes">No secondary denoising process will be used. The primary algorithm by itself usually performs well so this is the default.</property>
                    <property name="halign">start</property>
                    <property name="active">True</property>
                    <property name="draw-indicator">True</property>
                    <signal name="toggled" handler="update_sos" swapped="no"/>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">True</property>
                    <property name="position">0</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkRadioButton" id="radio_denoise_vst">
                    <property name="label" translatable="yes">Anscombe VST with exact unbiased inverse</property>
                    <property name="visible">True</property>
                    <property name="can-focus">True</property>
                    <property name="receives-default">False</property>
                    <property name="tooltip-text" translatable="yes">The Anscombe VST is useful when denoising photon-limited images where the noise characteristics are not Gaussian but primarily Poisson or a Poisson-Gaussian mix. It cannot be used in conjunction with DA3D or SOS. Ref: https://ieeexplore.ieee.org/document/5278406</property>
                    <property name="halign">start</property>
                    <property name="active">True</property>
                    <property name="draw-indicator">True</property>
                    <property name="group">radio_denoise_nosecondary</property>
                    <signal name="toggled" handler="update_sos" swapped="no"/>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">True</property>
                    <property name="position">1</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkRadioButton" id="radio_denoise_da3d">
                    <property name="label" translatable="yes">Data Adaptive Dual Domain Denoising</property>
                    <property name="visible">True</property>
                    <property name="can-focus">True</property>
                    <property name="receives-default">False</property>
                    <property name="tooltip-text" translatable="yes">Use DA3D as a final denoising step. This algorithm uses the output of the primary denoising algorithm as a guide image to perform frequency domain shrinkage on shape and data-adaptive patches. It never produces worse output than the primary algorithm and may improve detail retention and reduce staircasing artefacts. Ref: https://ieeexplore.ieee.org/document/7350835</property>
                    <property name="halign">start</property>
                    <property name="draw-indicator">True</property>
                    <property name="group">radio_denoise_nosecondary</property>
                    <signal name="toggled" handler="update_sos" swapped="no"/>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">True</property>
                    <property name="position">2</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkRadioButton" id="radio_denoise_sos">
                    <property name="label" translatable="yes">Strengthen Operate Subtract iterator</property>
                    <property name="visible">True</property>
                    <property name="can-focus">True</property>
                    <property name="receives-default">False</property>
                    <property name="tooltip-text" translatable="yes">SOS iteration works by iterating the primary denoising algorithm multiple times, each time mixing back a fraction of the noisy image. This can improve denoising performance and reduce staircasing artefacts. Ref: https://arxiv.org/abs/1502.06220</property>
                    <property name="halign">start</property>
                    <property name="draw-indicator">True</property>
                    <property name="group">radio_denoise_nosecondary</property>
                    <signal name="toggled" handler="update_sos" swapped="no"/>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">True</property>
                    <property name="position">3</property>
                  </packing>
                </child>
              </object>
            </child>
            <child type="label">
              <object class="GtkLabel">
                <property name="visible">True</property>
                <property name="can-focus">False</property>
                <property name="label" translatable="yes">Secondary Denoising Algorithm</property>
                <attributes>
                  <attribute name="weight" value="bold"/>
                </attributes>
              </object>
            </child>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="position">4</property>
          </packing>
        </child>
        <child>
          <object class="GtkFrame" id="sos_advanced_options">
            <property name="can-focus">False</property>
            <property name="label-xalign">0</property>
            <property name="shadow-type">none</property>
            <child>
              <!-- n-columns=2 n-rows=2 -->
              <object class="GtkGrid">
                <property name="visible">True</property>
                <property name="can-focus">False</property>
                <property name="halign">end</property>
                <property name="margin-top">5</property>
                <property name="row-spacing">5</property>
                <property name="column-spacing">5</property>
                <child>
                  <object class="GtkLabel">
                    <property name="visible">True</property>
                    <property name="can-focus">False</property>
                    <property name="tooltip-text" translatable="yes">Sets the number of SOS iterations. 3-5 is usually a good starting point.</property>
                    <property name="halign">end</property>
                    <property name="label" translatable="yes">SOS iterations</property>
                  </object>
                  <packing>
                    <property name="left-attach">0</property>
                    <property name="top-attach">0</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkSpinButton" id="spin_sos_iters">
                    <property name="visible">True</property>
                    <property name="can-focus">True</property>
                    <property name="tooltip-text" translatable="yes">Sets the number of SOS iterations. 3-5 iterations usually provides good convergence. Convergence can be seen by examining the updated image noise estimate shown in the log window after each iteration. (These noise values are measured after noise from the original image is mixed back in to prepare the next iteration, so the final output noise level is substantially lower than the intermediate values shown between iterations.)</property>
                    <property name="halign">end</property>
                    <property name="text">3</property>
                    <property name="adjustment">denoise_sos_adjustment</property>
                    <property name="value">3</property>
                  </object>
                  <packing>
                    <property name="left-attach">1</property>
                    <property name="top-attach">0</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkLabel">
                    <property name="visible">True</property>
                    <property name="can-focus">False</property>
                    <property name="tooltip-text" translatable="yes">rho sets the amount of the original noisy image at each iteration. A higher value means less noise is mixed in, and more of the intermediate result is kept. Values close to 0 or 1 may result in a need for more iterations to achieve convergence at the maximum improvement SOS can produce.</property>
                    <property name="halign">end</property>
                    <property name="label" translatable="yes">rho</property>
                  </object>
                  <packing>
                    <property name="left-attach">0</property>
                    <property name="top-attach">1</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkSpinButton" id="spin_rho">
                    <property name="visible">True</property>
                    <property name="can-focus">True</property>
                    <property name="tooltip-text" translatable="yes">Rho sets the amount of the original noisy image mixed back in between each SOS iteration. Up to a point, larger values will result in greater effectiveness but beyond a certain point the algorithm will fail to converge. The default of 0.2 is often a good starting point.</property>
                    <property name="halign">end</property>
                    <property name="text">0.50</property>
                    <property name="adjustment">denoise-rho-adjustment</property>
                    <property name="digits">2</property>
                    <property name="value">0.20</property>
                  </object>
                  <packing>
                    <property name="left-attach">1</property>
                    <property name="top-attach">1</property>
                  </packing>
                </child>
              </object>
            </child>
            <child type="label">
              <object class="GtkLabel">
                <property name="visible">True</property>
                <property name="can-focus">False</property>
                <property name="label" translatable="yes">SOS Advanced Options</property>
                <attributes>
                  <attribute name="weight" value="bold"/>
                </attributes>
              </object>
            </child>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="position">5</property>
          </packing>
        </child>
        <child>
          <object class="GtkBox">
            <property name="visible">True</property>
            <property name="can-focus">False</property>
            <property name="spacing">5</property>
            <child>
              <object class="GtkLabel">
                <property name="visible">True</property>
                <property name="can-focus">False</property>
                <property name="tooltip-text" translatable="yes">Modulation allows a fraction of the noisy image to be mixed into the denoised result. This may be useful to add microtexture if the denoised result looks artificially smooth. A value of 1 means the output will be 100% denoised, with none of the noisy image added. Modulation is performed at the end of the process, after primary and secondary denoising stages have both completed.</property>
                <property name="halign">start</property>
                <property name="label" translatable="yes">Modulation</property>
                <attributes>
                  <attribute name="weight" value="bold"/>
                </attributes>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">True</property>
                <property name="position">0</property>
              </packing>
            </child>
            <child>
              <object class="GtkSpinButton" id="spin_denoise_modulation">
                <property name="visible">True</property>
                <property name="can-focus">True</property>
                <property name="tooltip-text" translatable="yes">Sets modulation. The pixel value is calculated as m * b + (1-m) * orig, where m is the modulation, b is the denoised value and orig is the original pixel value. Modulation reduces the denoising performance, but a little modulation can be useful to add back microtexture to flat regions of the image.</property>
                <property name="halign">end</property>
                <property name="hexpand">True</property>
                <property name="adjustment">denoise-modulation-adjustment</property>
                <property name="digits">2</property>
                <property name="value">1</property>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">True</property>
                <property name="pack-type">end</property>
                <property name="position">2</property>
              </packing>
            </child>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="position">6</property>
          </packing>
        </child>
        <child>
          <object class="GtkScale" id="slide_denoise_modulation">
            <property name="visible">True</property>
            <property name="can-focus">True</property>
            <property name="tooltip-text" translatable="yes">Sets modulation. The pixel value is calculated as m * b + (1-m) * orig, where m is the modulation, b is the denoised value and orig is the original pixel value. Modulation reduces the denoising performance, but a little modulation can be useful to add back microtexture to flat regions of the image.</property>
            <property name="adjustment">denoise-modulation-adjustment</property>
            <property name="round-digits">1</property>
            <property name="digits">2</property>
            <property name="draw-value">False</property>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="position">7</property>
          </packing>
        </child>
      </object>
    </child>
  </object>
</interface>
