-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ Delete reference points from graphical editor + Choose which cut stack to save + Renamed loadImage.m to loadImageStack.m to disambiguate among apps
- Loading branch information
1 parent
4e849a4
commit a5d54b0
Showing
7 changed files
with
90 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
%% VolumeCut: Cut images along custom surfaces | ||
% Copyright (C) 2017,2018 Luca Della Santina | ||
% | ||
% This file is part of VolumeCut | ||
% | ||
% This program is free software: you can redistribute it and/or modify | ||
% it under the terms of the GNU General Public License as published by | ||
% the Free Software Foundation, either version 3 of the License, or | ||
% (at your option) any later version. | ||
% | ||
% This program is distributed in the hope that it will be useful, | ||
% but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
% GNU General Public License for more details. | ||
% | ||
% You should have received a copy of the GNU General Public License | ||
% along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
% This software is released under the terms of the GPL v3 software license | ||
% | ||
function [I, Isize, Ires] = loadImageStack(PathName, FileName) | ||
% Read the image size and resolution from file | ||
tmpImInfo = imfinfo([PathName FileName]); | ||
tmpImSizeZ = numel(tmpImInfo); | ||
tmpImSizeX = tmpImInfo.Width; | ||
tmpImSizeY = tmpImInfo.Height; | ||
Isize = [tmpImSizeX, tmpImSizeY, tmpImSizeZ]; | ||
|
||
% Read image resolution data | ||
try | ||
tmpXYres = 1/tmpImInfo(1).XResolution; | ||
if contains(tmpImInfo(1).ImageDescription, 'spacing=') | ||
tmpPos = strfind(tmpImInfo(1).ImageDescription,'spacing='); | ||
tmpZres = tmpImInfo(1).ImageDescription(tmpPos+8:end); | ||
tmpZres = regexp(tmpZres,'\n','split'); | ||
tmpZres = str2double(tmpZres{1}); | ||
else | ||
tmpZres = 0.3; % otherwise use default value | ||
end | ||
Ires = [tmpXYres, tmpXYres, tmpZres]; | ||
catch | ||
Ires = [1,1,1]; | ||
end | ||
|
||
% Load the image data into matlab | ||
fprintf('Loading image stack... '); | ||
I = uint8(ones(tmpImSizeX, tmpImSizeY, tmpImSizeZ)); | ||
for j = 1:tmpImSizeZ | ||
I(:,:,j)=imread([PathName FileName], j); | ||
end | ||
fprintf('DONE\n'); | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters