Skip to content
Snippets Groups Projects
Commit 58568100 authored by Eric Wait's avatar Eric Wait
Browse files

Only open 2-D as 3-D only if the whole image stack is already open

parent a9202ca6
No related branches found
No related tags found
No related merge requests found
......@@ -44,7 +44,6 @@ function [varargout] = Open( im, imData, imagePath, mesagePkgStr )
if (isempty(imData))
return
end
imagePath = imData.imageDir;
else
% there is an image to load just no metadata to go with it
% assume that the voxels are isomorphic
......@@ -58,13 +57,6 @@ function [varargout] = Open( im, imData, imagePath, mesagePkgStr )
end
end
%% open the region chooser if the image is too big
if (any(imData.Dimensions>2048))
D3d.UI.InitializeMipFigure(im,imData,imData.imageDir,true);
imData = [];
im = [];
end
%% if there is no metadata, get out without starting anything
if (isempty(imData))
if (nargout>1)
......@@ -77,7 +69,7 @@ function [varargout] = Open( im, imData, imagePath, mesagePkgStr )
end
%% if the data is 2D put time on the third dimension
if (imData.Dimensions(3)==1)
if (imData.Dimensions(3)==1 && ~isempty(im))
imData.Dimensions(3) = imData.NumberOfFrames;
imData.NumberOfFrames = 1;
......@@ -86,6 +78,18 @@ function [varargout] = Open( im, imData, imagePath, mesagePkgStr )
im = permute(im,[1,2,5,4,3]);
end
%% open the region chooser if the image is too big
if (any(imData.Dimensions>2048))
D3d.UI.InitializeMipFigure(im,imData,imData.imageDir,true);
if (nargout>1)
varargout{2} = [];
end
if (nargout>0)
varargout{1} = [];
end
return
end
%% start the viewer
if (~D3dIsOpen)
[pathstr,~,~] = fileparts(which('D3d.Viewer'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment