Giter Club home page Giter Club logo

mea_analysis_gui's People

Watchers

 avatar

mea_analysis_gui's Issues

Box_RF_fn_alt_vs.m

The variable RF_coords, which I assume stores information about the location of the Receptive field, can be assigned with values that are bigger than the number of pixel contained in the stimulus.
In my example I have a stimulus with size 20x20. However, RF_coords contains the value of 21 multiple times.

I assume the reason for this is line 37, but Iam not 100% sure what is checked in the if statement:

if max_RF_col_temp - p.RF_layers <= p.stim_columns - 1
    max_RF_col = max_RF_col_temp + p.RF_layers;
else
    max_RF_col = p.stim_columns;
end

If RF_coords contains values bigger than the number of pixel in the stimulus RF_Ident_fn_v7 crashes in line 1554

for j = 1:RF_Ident.STASD_Box_FullRF_Num_pixels
                        RF_Ident.STASD_Box_FullRF_STA{i}(j,:)  =    STA(RF_Ident.STASD_Box_FullRF_coords(j,1),RF_Ident.STASD_Box_FullRF_coords(j,2),:,i);
                        RF_Ident.STASD_Box_FullRF_STA_SD{i}(j) = STA_SD(RF_Ident.STASD_Box_FullRF_coords(j,1),RF_Ident.STASD_Box_FullRF_coords(j,2),i);
                    end

I have tried to quick-fixed it by changing Box_RF_fn_alt_vs.m in line 37 to only allow smaller cases in the first if statement. Not sure this makes sense in the context of what is done here and it still chrases sometimes.

if max_RF_col_temp - p.RF_layers < p.stim_columns - 1
    max_RF_col = max_RF_col_temp + p.RF_layers;
else
    max_RF_col = p.stim_columns;
end

RF_Ident_fn_v7

Should RF_Ident.STASD_Box_FullRF_Num_pixels be empty of zero if no significant pixel was found? In line 699 it is defined that this variable should be 0 if no significan pixel was found.

                if Sig_Pix_Indicator_STASD == 0
            
                if p.RF_Type(1) == 1 % Box
                    RF_Ident.STASD_Box_FullRF_Num_pixels = 0;
                end
                if p.RF_Type(2) == 1 % All Significant Pixels
                    RF_Ident.STASD_ASP_FullRF_Num_pixels = 0;
                end
                if p.RF_Type(3) == 1 % Gaussian
                    RF_Ident.STASD_Gaus_FullRF_Num_pixels = 0;
                end 

But than in line 1549 it is checked if the variable is empty
if ~isempty(RF_Ident.STASD_Box_FullRF_Num_pixels)...

Since RF_Ident.STASD_Box_FullRF_Num_pixels is 0 at this point it will pass the test in the if statement will run. However, in line 1563 the code tries to index into variables that are empty
RF_Ident.STASD_Box_FullRF_STA_time{i} = squeeze(STA(RF_Ident.STASD_Box_RF_coords_centre{maxSTASD_Box_index}(1),RF_Ident.STASD_Box_RF_coords_centre{maxSTASD_Box_index}(2),:,i));

I suggest either setting the variable to empty or testing against if the variable is 0 in the if statement.

spike_times_vec_loop bug

Line 653 and probably lines before (have to investigate):
spike_times_vec_loop(indices_loop) = a_loop + (spike_times_vec_loop(indices_loop) - a_dash_loop)*(b_loop - a_loop)/(b_dash_loop - a_dash_loop);

Some spiketimes are not set to the value they should have according to their position inside the noise chunk repeats. The following barplot shows the spiketimes in spike_times_vec_loop:
image
Notice the outliers in the spiketime, there is something wrong their. It looks like this happens mostly at the end of a loop, but not always. Possible connected to issue #2
Resulting error:

Index in position 3 is invalid. Array indices must be positive integers or logical values.

Error in STE_Full_fn (line 13)
STE_Full(:,:,:,i) = stimulus_arr(:,:,STE_index_loop-p.Num_STE_bins:STE_index_loop-1);

Error in RF_Ident_fn_v5 (line 207)
STE_Full(:,:,:,:,i) = STE_Full_fn(stimulus_arr(:,:,:,i),trig_times_vec,spike_times_vec,p);

Error in RF_Ident_CL_4_GUI_Ready (line 608)
RF_Ident{i} = RF_Ident_fn_v5(stimulus_arr,trig_times_vec_trunc,spike_times_vec_loop,length_spike_times_loop,p_par); % PAR Mod 27,08,2020 --> was 'RF_Ident_fn_v4' and
'trig_times_vec'

Deleting spikes from in between noise parts

Bug in line 566 of the RF_Ident_[....]Ready.mat file. Line 566, second part of the & argument

&(spike_times_vec_loop<trig_times_vec_par(j*p_par.stim_frames+p_par.Num_STE_bins+1))) = [];

trig_times_vec_par is a vector with dimension 1x8402
j = 7
p_par.stim_frames = 1200
p_par.Num_STE_bins = 20
j*p_par.stim_frames+p_par.Num_STE_bins+1 = 8421

this exceeds the limits of trig_times_vec_par and also cuts spikes from beyond the gap.

suggested fix:

trig_times_vec_par(j*p_par.stim_frames+1)
+1 because the next element in trig_times_vec_par is the first trigger of the next noise chunk, so we cut spikes from the end of the current noise chunk to the begining of the next.

Added some figures

Draw Problem in Kernels new

Some elements of the GUI (parameters on the left for calculating RF) are not drawing fast enough. I think this is because there is no direct callback untill "Find RFs" Button is clicked. Fix it by introducing some drawing commands...

Variables without function

p.Gap_Ind cannot be 1. But the only function for the variable is to be either 1 or 2. Should be deleted.

-v7.3 saving option

All analysis .mat files should be saved using the -v7.3 file formate to allow for partiall loading of data chunks out of big files.

Delete stimulus function

At the moment there is no way to remove a stimulus from the recording loaded, which should be possible.
The problem is that also all data that is connected to that stimulus need to be deleted properly or the gui will crash. Have to write a function which cleans all the data. Can probably use "delete_dataset" function.

Bug in STE_Full_fn_2

If STE_Full_Choise = 1 I get this error message.
Error using STE_Full_fn_2 (line 28)
Index in position 3 is invalid. Array indices must be positive integers or logical values.

Error in RF_Ident_fn_v8 (line 271)
STE_Full(:,:,:,:,i) = STE_Full_fn_2(stimulus_arr(:,:,:,i),trig_times_vec,spike_times_vec,p);
If STE_Full_Choise = 2 I get another error message

Error using STA_fn_2 (line 32)
Index in position 3 is invalid. Array indices must be positive integers or logical values.

Error in RF_Ident_fn_v8 (line 284)
STA(:,:,:,i)

STE_FULL_fn bug

Error message:
Index in position 3 is invalid. Array indices must be positive integers or logical values.

Error in STE_Full_fn (line 13)
STE_Full(:,:,:,i) = stimulus_arr(:,:,STE_index_loop-p.Num_STE_bins:STE_index_loop-1);

Error in RF_Ident_fn_v5 (line 207)
STE_Full(:,:,:,:,i) = STE_Full_fn(stimulus_arr(:,:,:,i),trig_times_vec,spike_times_vec,p);

Cause:

Index is negative at position 3 in line 13 in STE_Full_fn
STE_Full(:,:,:,i) = stimulus_arr(:,:,STE_index_loop-p.Num_STE_bins:STE_index_loop-1);

STE_index_loop-p.Num_STE_bins:STE_index_loop-1

ans =

-18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.