-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript4masking.m
56 lines (49 loc) · 1.88 KB
/
script4masking.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
%% Script to Identify CellFill and Recruitment Objects to make an 'AshleyFile' Object
% Update datafilepath variable below and then click the 'Run' button in the tool bar above.
%% add the correct path to your .tiff file data
datafilepath = 'G:\Sam\Data\Ashley\051318 NL1 insertion\8_merge.tif';
%%
% to view image series 'N' to go to next time slice 'P' for previous time
% slice. Use 'Mapping' tool bar at top to change the look up table.
% 'I' to zoom in or 'O' to zoom out.
addpath(genpath('Z:\Lab Resources\Analysis Resources\Matlab Resource\NeuronAnalysisToolBox'));
aa = AshleyAnalysis();
aa.path_3ch_datafile = datafilepath;
aa.cellFill = channelCellFill();
aa.surfaceCargo = channelSurfaceCargo();
aa.TfR = channelTfR();
% use last index to represent which stack to use
im_array = GeneralAnalysis.loadtiff_3ch(datafilepath);
aa.cellFill.setimage(im_array(:,:,:,2));
aa.surfaceCargo.setimage(im_array(:,:,:,3));
aa.TfR.setimage(im_array(:,:,:,1));
% trip the image
aa.cellFill.ROI_trim = [];
aa.cellFill.trim_rawimage()
aa.surfaceCargo.ROI_trim = aa.cellFill.ROI_trim;
aa.surfaceCargo.trim_rawimage;
aa.TfR.ROI_trim = aa.cellFill.ROI_trim;
aa.TfR.trim_rawimage;
% to see transferin channel
h = dipshow(aa.TfR.image);
dipmapping(h,'lin')
% to see cellFill channel
h = dipshow(aa.cellFill.image);
dipmapping(h,'lin')
% to see surface Cargo channel
h = dipshow(aa.surfaceCargo.image);
dipmapping(h,'lin')
% mask cell -- change these to modify image smoothing
aa.cellFill.lsig = [1 1 1];
aa.cellFill.gsig = [1 1 1];
aa.cellFill.mask_img;
aa.cellFill.viewMaskOverlayPerim;
% mask surface Cargo -- change these to modify image smoothing
aa.surfaceCargo.lsig = [1 1 3];
aa.surfaceCargo.gsig = [1 1 3];
aa.surfaceCargo.mask_img_highsens
aa.surfaceCargo.viewMaskOverlayPerim;
% select cell soma for the file
aa.cellFill.selectSoma();
% now save the object
save([datafilepath(1:end-4) '_AshleyFile.mat'], 'aa');