djamesbarker / pMAT

Fiber Photometry Modular Analysis Tool Suite
GNU General Public License v3.0
34 stars 10 forks source link

Questions about pmat.m and TrialPETHZScore.m in baseline calculations #12

Open CarloVid opened 1 year ago

CarloVid commented 1 year ago

Hello,

Firstly, I appreciate your dedication to developing this analysis software. I've been using the code and have encountered a couple of areas that I'm not quite sure about. It's entirely possible that I may be misunderstanding something, so please bear with me.

Question 1. In pmat.m on lines 1511 and 1512, it appears that the start time of the baseline (BL_Start) is being overwritten by the baseline window's length (BL_WidthInput).

BL_StartA=str2double(handles.BL_WidthInput.String); %Time before raster to start taking baseline
BL_Start=abs(BL_StartA);

Could you help me understand the reason behind this? I assumed that the BL_Start would typically be used to determine the starting point for the baseline.

Question 2.

In TrialPETHZScore.m on lines 100 and 101, I'm trying to understand the specific range that the code retrieves as the baseline.

CSBL(1,:)=Ch490((CSidx(i)-(BaselineWind+BaselineWind2)):(CSidx(i)-(BaselineWind))); 
CSBL2(1,:)=Ch405((CSidx(i)-(BaselineWind+BaselineWind2)):(CSidx(i)-(BaselineWind)));

In this formula, the start point of the baseline is determined by subtracting the combined values of both user-defined start time (BaselineWind) and window duration (BaselineWind2) from the event occurrence time. This seems to diverge from the user-defined start time.

Could you provide some insight into the logic behind this particular calculation?

Any clarification on these matters would be helpful. Thank you in advance!

Best regards, Carlos