Commit 4e38347a authored by Thomas Rogers Shaw's avatar Thomas Rogers Shaw
Browse files

Accept a different spatial window as input in spacewin_gui

parent b056116f
......@@ -11,9 +11,10 @@
% You should have received a copy of the GNU General Public License
% along with SMLM SPACETIME RESOLUTION. If not, see <https://www.gnu.org/licenses/>
function varargout = spacewin_gui(data,params)
function varargout = spacewin_gui(data,spacewin,params)
arguments
data (1,1) struct {mustHaveXYFields}
spacewin (1,1) struct {spacewin_isvalid} = struct('type', 'polyshape', 'p', polyshape())
params.PixelSize (1,1) double = 12
params.Ref = []
params.FigHandle (1,1) logical = false;
......@@ -55,7 +56,16 @@ hold(ax, 'on');
axis(ax,'tight');
ax.Toolbar.Visible = 'off';
ax.Interactions = [zoomInteraction, regionZoomInteraction];
handles.p = polyshape();
switch spacewin.type
case 'polyshape'
handles.p = spacewin.p;
case 'polygon'
handles.p = polyshape(spacewin.x, spacewin.y)
otherwise
warning('spacewin_gui: I don''t yet know how to handle this input window type, using a blank one')
handles.p = polyshape();
end
handles.p_obj = [];
% set up the various buttons
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment