SergeDmi / ConfocalGN

Generates simulated confocal data from a ground truth signal
http://biophysics.fr/2016/06/27/generating-confocal-data-from-ideal-signal/
GNU General Public License v3.0
8 stars 4 forks source link

Error when manually entering signal and noise values #2

Closed jabruniessner closed 2 years ago

jabruniessner commented 2 years ago

Hey there,

I just stumbled over a new issue with the example code. In the example somewhere, I find the bit of code

   %% Here we present two ways of using ConfocalGN

   if 1  
   % Reading Noise and Signal parameters from image
   sample='sample_image4.tif';
   %% Generating the stack from the image
   [res,truth,sample]=confocal_generator(truth,conf,sample);
   else
   % Using user-defined noise and signal values
   salmple.noise=[556 1.0371e+04 1.0926e+06]';
   sample.sig=1.0022e+03;
   %% Generating the stack from the image
   [res,truth,sample]=confocal_generator(truth,conf,sample);
   end
   %% Output : 

The way I understand it is that we plug in 1 for the if-statement if we want to provide a sample image and 0 if we want to manually enter a signal and noise value. Is this correct? Because if I plug in 0 I get the folowing error message

 Error using confocal_generator (line 125)
 You must provide a valid sample for noise and signal

  Error in cgn_example (line 46)
  [res,truth,sample]=confocal_generator(truth,conf,sample);

Could you explain to me what I am doing wrong?

SergeDmi commented 2 years ago

Hello, It seems there was a typo (salmple.noise instead of sample.noise) that I just fixed. I don't have access to matlab right now, could you check it out ?

jabruniessner commented 2 years ago

Yep, works! Thank you very much!