-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXT_Mouse_Cells_Volumes.m
More file actions
93 lines (84 loc) · 2.78 KB
/
XT_Mouse_Cells_Volumes.m
File metadata and controls
93 lines (84 loc) · 2.78 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
%
%
% Mouse Cells Volumes Function for Imaris 7.3.1 (and Sylvain)
%
%
% Installation:
%
% - Copy this file into the XTensions folder in the Imaris installation directory
% - You will find this function in the Image Processing menu
%
% <CustomTools>
% <Menu>
% <Submenu name="Mouse">
% <Item name="Mouse : Cell volumes (Sylvain)" icon="Matlab" tooltip="Computes the volumes corresponding to the cells.">
% <Command>MatlabXT::XT_Mouse_Cells_Volumes(%i)</Command>
% </Item>
% </Submenu>
% </Menu>
% </CustomTools>
%
%
% Description:
%
% Computes the volumes corresponding to the cells..
%
function XT_Mouse_Cells_Volumes(aImarisApplicationID)
% get the application object
if isa(aImarisApplicationID, 'Imaris.IApplicationPrxHelper')
% called from workspace
vImarisApplication = aImarisApplicationID;
else
% connect to Imaris interface
javaaddpath ImarisLib.jar
vImarisLib = ImarisLib;
if ischar(aImarisApplicationID)
aImarisApplicationID = round(str2double(aImarisApplicationID));
end
vImarisApplication = vImarisLib.GetApplication(aImarisApplicationID);
end
%% User interface
aDataSet = vImarisApplication.GetDataSet();
aSurpassScene = vImarisApplication.GetSurpassScene();
sizeC = aDataSet.GetSizeC;
% Spacing
sizeX = aDataSet.GetSizeX;
sizeY = aDataSet.GetSizeY;
extendMinX = aDataSet.GetExtendMinX;
extendMinY = aDataSet.GetExtendMinY;
extendMaxX = aDataSet.GetExtendMaxX;
extendMaxY = aDataSet.GetExtendMaxY;
spacingX = (extendMaxX - extendMinX) / sizeX;
spacingY = (extendMaxY - extendMinY) / sizeY;
% sizeZ = aDataSet.GetSizeZ;
% extendMinZ = aDataSet.GetExtendMinZ;
% extendMaxZ = aDataSet.GetExtendMaxZ;
% spacingZ = (extendMaxZ - extendMinZ) / sizeZ;
% Filter size
aSize = [5 5 5];
% We have the user input information
name='Parameters';
numlines=1;
prompt{1}='DAPI channel number ?';
prompt{2}='Z shift DAPI ?';
prompt{3}='Objects size ? (µm)';
defaultanswer{1}=num2str(sizeC);
defaultanswer{2}=num2str(0);
defaultanswer{3}=num2str(6.5);
answer = inputdlg(prompt,name,numlines,defaultanswer);
if isempty(answer)
return;
end
dapi=floor(str2double(answer{1})-1);
shift=floor(str2double(answer{2}));
objectsSize=floor(str2double(answer{3})-1);
%% Processing
% Shift
vImarisApplication.GetImageProcessing.Shift3DChannel(aDataSet,dapi,0,0,shift);
% Median filter
vImarisApplication.GetImageProcessing.MedianFilterChannel(aDataSet,dapi,aSize);
% Segmentation
%aSurfaces = vImarisApplication.GetImageProcessing.DetectSurfacesRegionGrowing(aDataSet,[],dapi,spacingX+spacingY,0,1,0.0,objectsSize,1,'"Quality" above 0','"Volume" above 20.000 um^3');
aSurfaces = vImarisApplication.GetImageProcessing.DetectSpots2(aDataSet,[],dapi,objectsSize,0,'"Quality" above automatic threshold');
aSurpassScene.AddChild(aSurfaces,-1);
end