Skip to content

Commit b9fae21

Browse files
committed
Update revision.jl to modify image and stimulus file paths, disable spike train analysis, and add functionality to save analysis figures for both raw data and ROI analysis, enhancing data processing and visualization capabilities.
1 parent 0956f39 commit b9fae21

File tree

1 file changed

+28
-14
lines changed

1 file changed

+28
-14
lines changed

test/revision.jl

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,27 @@ using PhysiologyAnalysis
1010

1111

1212
# ╔═╡This task is for extraction of points, centroids, and ROIs using cellpose
13-
img_fn = raw"F:\Data\Two Photon\2025-05-02-GRAB-DA-nirCAT-STR\grab-nircat-str-kpuff_3x012.tif"
14-
stim_fn = raw"F:\Data\Patching\2025-05-02-GRAB-DA-STR\25502017.abf"
13+
#Kpuff looks really good
14+
15+
# #We should look through the available files and see which ones fit
16+
# img_fn = raw"F:\Data\Two Photon\2025-05-02-GRAB-DA-nirCAT-STR\grab-nircat-str-20hz-100uA001.tif"
17+
# stim_fn = raw"F:\Data\Patching\2025-05-02-GRAB-DA-STR\25502000.abf"
18+
19+
#Good but a big bubble
20+
# img_fn = raw"F:\Data\Two Photon\2025-05-02-GRAB-DA-nirCAT-STR\grab-nircat-str-3s_20hz_30uA_3x006.tif"
21+
# stim_fn = raw"F:\Data\Patching\2025-05-02-GRAB-DA-STR\25502007.abf"
1522

16-
#We should look through the available files and see which ones fit
17-
img_fn = raw"F:\Data\Two Photon\2025-05-02-GRAB-DA-nirCAT-STR\grab-nircat-str-20hz-100uA001.tif"
18-
stim_fn = raw"F:\Data\Patching\2025-05-02-GRAB-DA-STR\25502000.abf"
23+
img_fn = raw"F:\Data\Two Photon\2025-05-02-GRAB-DA-nirCAT-STR\grab-nircat-str-kpuff011.tif"
24+
stim_fn = raw"F:\Data\Patching\2025-05-02-GRAB-DA-STR\25502015.abf"
1925

20-
#We should look through the available files and see which ones fit
21-
img_fn = raw"F:\Data\Two Photon\2025-05-02-GRAB-DA-nirCAT-STR\grab-nircat-str-20hz-100uA001.tif"
22-
stim_fn = raw"F:\Data\Patching\2025-05-02-GRAB-DA-STR\25502000.abf"
26+
#%%
27+
img_fn = raw"F:\Data\Two Photon\2025-05-02-GRAB-DA-nirCAT-STR\grab-nircat-str-kpuff_3x012.tif"
28+
stim_fn = raw"F:\Data\Patching\2025-05-02-GRAB-DA-STR\25502017.abf"
2329

2430
data2P = readImage(img_fn);
2531
deinterleave!(data2P) #This seperates the movies into two seperate movies
2632

27-
spike_train = true
33+
spike_train = false
2834
if spike_train
2935
#If we have a electrical stimulus we need to do the spike train analysis
3036
addStimulus!(data2P, stim_fn, "IN 3", flatten_episodic = true, stimulus_threshold = 0.5)
@@ -35,6 +41,7 @@ else
3541
addStimulus!(data2P, stim_fn, "IN 2", flatten_episodic = true)
3642
time2P = data2P.t
3743
end
44+
getStimulusProtocol(data2P)
3845

3946
# Split the image into 8x8 pixel ROIs
4047
pixel_splits_roi!(data2P, 8)
@@ -62,11 +69,18 @@ println("Found $(length(sig_rois)) significant ROIs")
6269
fit_params = get_fit_parameters(roi_analysis)
6370
println("Mean amplitude of significant ROIs: ", mean(first.(fit_params)))
6471

65-
fig = plot_roi_analysis(data2P, stim_idx = 2)
66-
display(fig)
67-
68-
6972
#%% Test the new simple analysis plot function
7073
PhysiologyPlotting.__init__()
7174
fig_raw = PhysiologyPlotting.plot_analysis(data2P)
72-
display(fig_raw)
75+
# display(fig_raw)
76+
77+
#%%
78+
# Save the raw analysis figure
79+
save(raw"F:\Data\Analysis\StriatumAnalysis\Potassium Puffs\fig_raw.png", fig_raw)
80+
81+
#%%
82+
fig = plot_roi_analysis(data2P, stim_idx = 2)
83+
display(fig)
84+
85+
# Save the ROI analysis figure
86+
save(raw"F:\Data\Analysis\StriatumAnalysis\Potassium Puffs\fig_roi_analysis.png", fig)

0 commit comments

Comments
 (0)