Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 16 additions & 25 deletions software/setROIfromForcemap.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,20 @@
forceProc = tfmPackage.getProcess(4);
p = forceProc.funParams_;
% Load displ process
try
displProc = tfmPackage.getProcess(3);
catch
% ---------- Modified by Waddah Moghram on 3/7/2019
displProc = tfmPackage.getProcess(3);
if isempty(displProc) % No correction to displacement step
displProc = tfmPackage.getProcess(2);
end
displField=displProc.loadChannelOutput;
% SDC proc
try
SDCProc = tfmPackage.getProcess(1);
catch
%------------------------------------
% % SDC proc---------------
% ----------- Lines below commented out and corrected by Waddah Moghram on 3/7/2019
SDCProc = tfmPackage.getProcess(1);
if isempty(SDCProc) % No Stage Drift Step was Done
SDCProc = tfmPackage.getProcess(2);
end
%-----------------------
% Get force map
% try
% tMap = load(forceProc.outFilePaths_{2});
Expand All @@ -63,7 +65,9 @@
% tMap = load(forceProc.outFilePaths_{2});
% tMap = tMap.tMap;
% end
refFrame = double(imread(SDCProc.outFilePaths_{2,1}));
%---------------- Corrected by Waddah Moghram. Should be reference frame, not dispMaps.mat on 3/7/2019
refFrame = imread(SDCProc.funParams_.referenceFramePath);
%----------------------------------

% Use mask of first frame to filter bead detection
firstMask = refFrame>0; %false(size(refFrame));
Expand All @@ -80,7 +84,10 @@
else
roiMask=imread(MD.roiMaskPath_);
boundROI=bwboundaries(roiMask);
hold on, plot(boundROI{1}(:,2),boundROI{1}(:,1),'w')
% ----- if-statement added by Waddah Moghram on 3/7/2019
if ~isempty(boundROI)
hold on, plot(boundROI{1}(:,2),boundROI{1}(:,1),'w')
end % -------------------------
h=imrect;
end
ROI_rect = wait(h);
Expand All @@ -95,19 +102,3 @@
% maskArray = MD.getROIMask;
close(h2)
disp('ROI created!')