Class fMRIBlindDeconvolution

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.WindowListener, java.lang.Runnable, java.util.EventListener

    public class fMRIBlindDeconvolution
    extends AlgorithmBase
    • Field Detail

      • MIN_DELTA

        private final double MIN_DELTA
        Reference: Hamza Cherkaoui, Thomas Moreau, Abderrahim Halimi, Philippe Ciuciu. Sparsity-based blind deconvolution of neural activation signal in fMRI. IEEE-ICASSP 2019 - International Conference on Acoustics, Speech and Signal Processing, May 2019, Brighton, United Kingdom. ffhal-02085810v2
        See Also:
        Constant Field Values
    • Constructor Detail

      • fMRIBlindDeconvolution

        public fMRIBlindDeconvolution()
    • Method Detail

      • runAlgorithm

        public void runAlgorithm()
        Description copied from class: AlgorithmBase
        Actually runs the algorithm. Implemented by inheriting algorithms.
        Specified by:
        runAlgorithm in class AlgorithmBase
      • spm_hrf

        public void spm_hrf​(double[] hrf,
                            double[] t_hrf,
                            double delta,
                            double t_r,
                            double dur,
                            boolean normalized_hrf,
                            double dt,
                            double p_delay,
                            double undershoot,
                            double p_disp,
                            double u_disp,
                            double p_u_ratio,
                            double onset)
      • test_power_2_padding_length

        public void test_power_2_padding_length()
      • test_zero_padd_unpadd

        public void test_zero_padd_unpadd()
      • test_zero_mirror_zero_padd_unpadd

        public void test_zero_mirror_zero_padd_unpadd()
      • _padd_symetric

        public double[] _padd_symetric​(double[] arrays,
                                       int p,
                                       double c,
                                       java.lang.String paddtype)
      • _padd_symetric

        public double[][] _padd_symetric​(double[][] arrays,
                                         int p,
                                         double c,
                                         java.lang.String paddtype)
      • _padd_assymetric

        public double[] _padd_assymetric​(double[] arrays,
                                         int[] p,
                                         double c,
                                         java.lang.String paddtype)
      • _padd_assymetric

        public double[][] _padd_assymetric​(double[][] arrays,
                                           int[] p,
                                           double c,
                                           java.lang.String paddtype)
      • _unpadd_symetric

        public double[] _unpadd_symetric​(double[] arrays,
                                         int p,
                                         java.lang.String paddtype)
      • _unpadd_symetric

        public double[][] _unpadd_symetric​(double[][] arrays,
                                           int p,
                                           java.lang.String paddtype)
      • _unpadd_assymetric

        public double[] _unpadd_assymetric​(double[] arrays,
                                           int[] p,
                                           java.lang.String paddtype)
      • _unpadd_assymetric

        public double[][] _unpadd_assymetric​(double[][] arrays,
                                             int[] p,
                                             java.lang.String paddtype)
      • log2

        public double log2​(double x)
      • _custom_padd

        public double[] _custom_padd​(int[] p_total,
                                     double[] a,
                                     int min_power_of_2,
                                     int min_zero_padd,
                                     double zero_padd_ratio)
      • custom_padd

        public double[][] custom_padd​(int[] padd,
                                      double[][] arrays,
                                      int min_power_of_2,
                                      int min_zero_padd,
                                      double zero_padd_ratio)
      • rfft

        public double[][] rfft​(double[] x)
      • irfft

        public double[] irfft​(double[][] x,
                              boolean isOdd)
      • spectral_convolve

        public double[] spectral_convolve​(double[] k,
                                          double[] xin)
      • spectral_retro_convolve

        public double[] spectral_retro_convolve​(double[] k,
                                                double[] xin)
      • zabs

        private double zabs​(double zr,
                            double zi)
        zabs computes the absolute value or magnitude of a double precision complex variable zr + j*zi.
        Parameters:
        zr - double
        zi - double
        Returns:
        double
      • zdiv

        private void zdiv​(double ar,
                          double ai,
                          double br,
                          double bi,
                          double[] cr,
                          double[] ci)
        complex divide c = a/b.
        Parameters:
        ar - double
        ai - double
        br - double
        bi - double
        cr - double[]
        ci - double[]
      • spectral_deconvolve

        public double[] spectral_deconvolve​(double[] k,
                                            double[] x)
      • spectral_retro_deconvolve

        public double[] spectral_retro_deconvolve​(double[] k,
                                                  double[] x)
      • toeplitz_from_kernel

        public double[][] toeplitz_from_kernel​(double[] k,
                                               int dim_in,
                                               int dim_out)
      • simple_convolve

        public double[] simple_convolve​(double[] k,
                                        double[] x,
                                        int dim_out)
      • simple_retro_convolve

        public double[] simple_retro_convolve​(double[] k,
                                              double[] x,
                                              int dim_out)
      • median

        public double median​(double[] x)
      • mad

        public double mad​(double[] x,
                          double c)
      • mad_daub_noise_est

        public double mad_daub_noise_est​(double[] x,
                                         double c)
      • fwhm

        public double fwhm​(double[] t_hrf,
                           double[] hrf,
                           int k)
      • tp

        public double tp​(double[] t_hrf,
                         double[] hrf)
      • random_generator

        public java.util.Random random_generator​(long random_state)
      • test_inf_norm

        public void test_inf_norm()
      • __inf_norm

        public double[] __inf_norm​(double[] x)
      • _inf_norm

        public double[][] _inf_norm​(double[][] arr,
                                    int axis)
      • _inf_norm

        public double[][] _inf_norm​(double[][][] arr,
                                    int axis)
      • __inf_norm

        public double[][][] __inf_norm​(double[][][] x)
      • norm

        public double norm​(double[] x)
      • add_gaussian_noise

        public void add_gaussian_noise​(double[] noisy_signal,
                                       double[] noise,
                                       double[] signal,
                                       double snr,
                                       boolean haveSeed,
                                       long random_state)
      • gen_rnd_ai_s

        public void gen_rnd_ai_s​(double[] ai_s,
                                 double[] i_s,
                                 double[] t,
                                 double dur,
                                 double tr,
                                 int nb_events,
                                 int avg_dur,
                                 double std_dur,
                                 boolean middle_spike,
                                 boolean overlapping,
                                 boolean unitary_block,
                                 boolean haveSeed,
                                 long random_state,
                                 int nb_try,
                                 int nb_try_duration,
                                 boolean centered)
      • gen_rnd_bloc_bold

        public void gen_rnd_bloc_bold​(double[] noisy_ar_s,
                                      double[] ar_s,
                                      double[] ai_s,
                                      double[] i_s,
                                      double[] t,
                                      double[] noise,
                                      double dur,
                                      double tr,
                                      boolean sourcehrf,
                                      double[] hrf,
                                      int nb_events,
                                      int avg_dur,
                                      double std_dur,
                                      boolean middle_spike,
                                      boolean overlapping,
                                      boolean unitary_block,
                                      double snr,
                                      int nb_try,
                                      int nb_try_duration,
                                      boolean centered,
                                      boolean haveSeed,
                                      long random_state)
      • _yield_data

        public void _yield_data​(double[][] noisy_ar_s,
                                double[][] ar_s,
                                double[][] ai_s,
                                double[][] i_s,
                                double[][] hrf,
                                double[][] noise,
                                double[] snr,
                                int[] nb_events)
      • _test_data

        public void _test_data​(double[] noisy_ar_s,
                               double[] ar_s,
                               double[] ai_s,
                               double[] i_s,
                               double[] hrf,
                               double[] noise,
                               double snr,
                               int nb_events,
                               java.lang.String testnum)
      • test_data_gen

        public void test_data_gen()
      • gen_regular_ai_s

        public void gen_regular_ai_s​(double[] ai_s,
                                     double[] i_s,
                                     double[] t,
                                     int dur,
                                     double tr,
                                     double dur_bloc,
                                     boolean centered)
      • gen_regular_bloc_bold

        public void gen_regular_bloc_bold​(double[] noisy_ar_s,
                                          double[] ar_s,
                                          double[] ai_s,
                                          double[] i_s,
                                          double[] t,
                                          double[] noise,
                                          int dur,
                                          double tr,
                                          double dur_bloc,
                                          boolean sourcehrf,
                                          double[] hrf,
                                          double snr,
                                          boolean haveSeed,
                                          long random_state)
      • gen_rnd_i_s

        public void gen_rnd_i_s​(double[] i_s,
                                double[] t,
                                int dur,
                                double tr,
                                int nb_events,
                                double avg_ampl,
                                double std_ampl,
                                boolean haveSeed,
                                long random_state,
                                int nb_try,
                                int nb_try_duration,
                                boolean centered)
      • gen_rnd_event_bold

        public void gen_rnd_event_bold​(double[] noisy_ar_s,
                                       double[] ar_s,
                                       double[] i_s,
                                       double[] t,
                                       double[] noise,
                                       int dur,
                                       double tr,
                                       boolean sourcehrf,
                                       double[] hrf,
                                       int nb_events,
                                       double avg_ampl,
                                       double std_ampl,
                                       double snr,
                                       boolean haveSeed,
                                       long random_state)
      • yield_diracs_signal

        public void yield_diracs_signal​(double[][] i_s,
                                        double[][] hrf,
                                        double[][] alpha,
                                        double[] tr)
      • yield_blocks_signal

        public void yield_blocks_signal​(double[][] ai_s,
                                        double[][] hrf,
                                        double[][] alpha,
                                        double[] tr)
      • _test_conv_toeplitz_kernel_hrf

        public void _test_conv_toeplitz_kernel_hrf​(double[] ai_s,
                                                   double[] hrf,
                                                   java.lang.String testname)
      • test_toeplitz_convolution_kernel_hrf_on_dirac

        public void test_toeplitz_convolution_kernel_hrf_on_dirac()
      • test_toeplitz_convolution_kernel_hrf_on_ai_s

        public void test_toeplitz_convolution_kernel_hrf_on_ai_s()
      • _test_conv_fourier_kernel_hrf

        public void _test_conv_fourier_kernel_hrf​(double[] ai_s,
                                                  double[] hrf,
                                                  java.lang.String testname)
      • test_fourier_convolution_kernel_hrf_on_dirac

        public void test_fourier_convolution_kernel_hrf_on_dirac()
      • test_fourier_convolution_kernel_hrf_on_ai_s

        public void test_fourier_convolution_kernel_hrf_on_ai_s()
      • _test_conv_adj_toeplitz_kernel_hrf

        public void _test_conv_adj_toeplitz_kernel_hrf​(double[] ai_s,
                                                       double[] hrf,
                                                       java.lang.String testname)
      • test_toeplitz_adj_convolution_kernel_hrf_on_dirac

        public void test_toeplitz_adj_convolution_kernel_hrf_on_dirac()
      • test_toeplitz_adj_convolution_kernel_hrf_on_ai_s

        public void test_toeplitz_adj_convolution_kernel_hrf_on_ai_s()
      • _test_conv_adj_fourier_hrf

        public void _test_conv_adj_fourier_hrf​(double[] ai_s,
                                               double[] hrf,
                                               java.lang.String testname)
      • test_fourier_adj_convolution_kernel_hrf_on_dirac

        public void test_fourier_adj_convolution_kernel_hrf_on_dirac()
      • test_fourier_adj_convolution_kernel_hrf_on_ai_s

        public void test_fourier_adj_convolution_kernel_hrf_on_ai_s()
      • _test_conv_toeplitz_kernel_signal

        public void _test_conv_toeplitz_kernel_signal​(double[] ai_s,
                                                      double[] hrf,
                                                      java.lang.String testname)
      • test_toeplitz_convolution_kernel_signal_on_dirac

        public void test_toeplitz_convolution_kernel_signal_on_dirac()
      • test_toeplitz_convolution_kernel_signal_on_ai_s

        public void test_toeplitz_convolution_kernel_signal_on_ai_s()
      • _test_conv_adj_toeplitz_kernel_signal

        public void _test_conv_adj_toeplitz_kernel_signal​(double[] ai_s,
                                                          double[] hrf,
                                                          java.lang.String testname)
      • test_toeplitz_adj_convolution_kernel_signal_on_dirac

        public void test_toeplitz_adj_convolution_kernel_signal_on_dirac()
      • test_toeplitz_adj_convolution_kernel_signal_on_ai_s

        public void test_toeplitz_adj_convolution_kernel_signal_on_ai_s()
      • test_integ_op

        public void test_integ_op()
      • test_integ_adj

        public void test_integ_adj()
      • sign

        public double sign​(double x)
      • deconv

        public void deconv​(double[] x,
                           double[] z,
                           double[] diff_z,
                           java.util.Vector<java.lang.Double> J,
                           java.util.Vector<java.lang.Double> R,
                           java.util.Vector<java.lang.Double> G,
                           double[] y,
                           double t_r,
                           double[] hrf,
                           double lbda,
                           boolean early_stopping,
                           double tol,
                           int wind,
                           int nb_iter,
                           int nb_sub_iter,
                           int verbose)
      • std

        public double std​(double[] x)
      • deconv_example

        public void deconv_example()
      • hrf_fit_err

        public double hrf_fit_err​(double theta,
                                  double[] z,
                                  double[] y,
                                  double t_r,
                                  double hrf_dur)
      • hrf_estim

        public void hrf_estim​(double[] h,
                              java.util.Vector<java.lang.Double> J,
                              double[] z,
                              double[] y,
                              double t_r,
                              double dur,
                              int verbose)
      • simple_hrf_estimation

        public void simple_hrf_estimation()
      • _loops_deconv

        public double[] _loops_deconv​(double[] y,
                                      double[] diff_z,
                                      double[][] H,
                                      double lbda,
                                      long nb_iter,
                                      boolean early_stopping,
                                      long wind,
                                      double tol)
      • bd

        public void bd​(java.util.Vector<java.lang.Double> xout,
                       java.util.Vector<java.lang.Double> zout,
                       java.util.Vector<java.lang.Double> diff_zout,
                       java.util.Vector<java.lang.Double> hout,
                       java.util.Vector<java.lang.Double> dr,
                       java.util.Vector<java.lang.Double> dg,
                       java.util.Vector<java.lang.Double> dJ,
                       double[] y,
                       double t_r,
                       double lbda,
                       double theta,
                       double[] z_0,
                       double hrf_dur,
                       double[] bounds,
                       int nb_iter,
                       int nb_sub_iter,
                       int nb_last_iter,
                       int print_period,
                       boolean early_stopping,
                       int wind,
                       double tol,
                       int verbose)
      • blind_deconvolution_example

        public void blind_deconvolution_example()
      • inf_norm

        private double inf_norm​(double[] x)
      • inf_norm

        private double inf_norm​(java.util.Vector<java.lang.Double> x)
      • data_generation_example

        public void data_generation_example()