Skip to content
Snippets Groups Projects
Commit 8a822f73 authored by Mark Winter's avatar Mark Winter
Browse files

Renamed CheckLocked to CheckTreeLocked. Also added a SetTreeLocked.

parent 846c4f01
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ if(~isempty(Tracks.GetTimeOfDeath(trackID)) && Tracks.GetTimeOfDeath(trackID)<=t
end
bOverrideLock = 0;
bLocked = Helper.CheckLocked([trackID siblingTrack]);
bLocked = Helper.CheckTreeLocked([trackID siblingTrack]);
if ( any(bLocked) )
lockedList = [];
if ( bLocked(1) )
......@@ -62,7 +62,7 @@ if(CellTracks(trackID).startTime==time)
case 'Cancel'
return
end
elseif ( ~bOverrideLock && Helper.CheckLocked(parentTrack) )
elseif ( ~bOverrideLock && Helper.CheckTreeLocked(parentTrack) )
rootTrack = CellFamilies(CellTracks(parentTrack).familyID).rootTrackID;
resp = questdlg(['This edit will affect locked tree(s) ' num2str(rootTrack) '. Do you wish to continue?'], 'Warning: Locked Tree', 'Continue', 'Cancel', 'Cancel');
if ( strcmpi(resp,'Cancel') )
......
......@@ -8,7 +8,7 @@ function historyAction = ContextSwapLabels(trackA, trackB, time)
Tracker.GraphEditSetEdge(trackA, trackB, time);
Tracker.GraphEditSetEdge(trackB, trackA, time);
bLocked = Helper.CheckLocked([trackA trackB]);
bLocked = Helper.CheckTreeLocked([trackA trackB]);
if ( any(bLocked) )
Tracks.LockedSwapLabels(trackA, trackB, time);
else
......
......@@ -53,7 +53,7 @@ function historyAction = CreateMitosisAction(treeID, time, linePoints)
end
childTrack = Hulls.GetTrackID(childHulls(2));
if ( Helper.CheckLocked(childTrack) )
if ( Helper.CheckTreeLocked(childTrack) )
error('Not yet implemented: Locked "addMitosis"');
else
Families.AddMitosis(childTrack, balancedTrack, time);
......
......@@ -11,7 +11,7 @@ function historyAction = TreeLockAction(familyID)
end
bIsLocked = CellFamilies(familyID).bLocked;
CellFamilies(familyID).bLocked = ~bIsLocked;
Helper.SetTreeLocked(familyID, ~bIsLocked);
historyAction = 'Push';
end
\ No newline at end of file
% bLocked = CheckLocked(tracks)
% bLocked = CheckTreeLocked(tracks)
%
% Check if tracks are on locked families, return list bLocked with boolean
% indicator per track.
function bLocked = CheckLocked(tracks)
function bLocked = CheckTreeLocked(tracks)
global CellTracks CellFamilies
famIDs = [CellTracks(tracks).familyID];
......
function SetTreeLocked(treeID, bLocked)
global CellFamilies
CellFamilies(treeID).bLocked = (bLocked ~= 0);
end
......@@ -161,7 +161,7 @@ function hullID = mergeOverlapping(objs, chkPoint, time)
mergeHulls = frameHulls(bMergeHulls);
rmTracks = Hulls.GetTrackID(mergeHulls);
bLockedTracks = Helper.CheckLocked(rmTracks);
bLockedTracks = Helper.CheckTreeLocked(rmTracks);
mergeHulls = mergeHulls(~bLockedTracks);
if ( ~isempty(mergeHulls) )
......
......@@ -7,7 +7,7 @@ function [bLocked bCanChange] = CheckLockedChangeLabel(currentTrack, desiredTrac
global CellTracks
bCanChange = 1;
bLocked = Helper.CheckLocked([currentTrack desiredTrack]);
bLocked = Helper.CheckTreeLocked([currentTrack desiredTrack]);
% Current track is on locked tree
if ( bLocked(1) )
......
......@@ -209,7 +209,7 @@ function removeFromTree(src,evnt)
oldParent = CellTracks(trackID).parentTrack;
bLocked = Helper.CheckLocked(trackID);
bLocked = Helper.CheckTreeLocked(trackID);
if ( bLocked )
resp = questdlg('This edit will affect the structure of tracks on a locked tree, do you wish to continue?', 'Warning: Locked Tree', 'Continue', 'Cancel', 'Cancel');
if ( strcmpi(resp,'Cancel') )
......
......@@ -59,7 +59,7 @@ object = get(gco);
if(strcmp(object.Type,'text') || strcmp(object.Marker,'o'))
%clicked on a node
curTrack = object.UserData;
bLocked = Helper.CheckLocked(curTrack);
bLocked = Helper.CheckTreeLocked(curTrack);
if(isempty(CellTracks(curTrack).parentTrack))
msgbox('No Mitosis to Remove','Unable to Remove Mitosis','error');
......@@ -77,7 +77,7 @@ if(strcmp(object.Type,'text') || strcmp(object.Marker,'o'))
elseif(object.YData(1)==object.YData(2))
%clicked on a horizontal line
curTrack = object.UserData;
bLocked = Helper.CheckLocked(curTrack);
bLocked = Helper.CheckTreeLocked(curTrack);
if ( bLocked )
resp = questdlg('This edit will affect the structure of tracks on a locked tree, do you wish to continue?', 'Warning: Locked Tree', 'Continue', 'Cancel', 'Cancel');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment