mirror of
https://github.com/c-sooyoung/fold_slice.git
synced 2026-09-17 20:39:08 +09:00
initial commit
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
function [] = save_tiff_image(I, path)
|
||||
% Wrapper function for saving 16-bit .tiff image
|
||||
% Written by YJ
|
||||
% ** I: 2D image
|
||||
% ** path: file path
|
||||
|
||||
tagstruct.ImageLength = size(I,1);
|
||||
tagstruct.ImageWidth = size(I,2);
|
||||
tagstruct.Photometric = Tiff.Photometric.MinIsBlack;
|
||||
tagstruct.BitsPerSample = 16;
|
||||
tagstruct.SamplesPerPixel = 1;
|
||||
tagstruct.RowsPerStrip = 16;
|
||||
tagstruct.PlanarConfiguration = Tiff.PlanarConfiguration.Chunky;
|
||||
tagstruct.Software = 'MATLAB';
|
||||
t = Tiff(path,'w');
|
||||
t.setTag(tagstruct)
|
||||
t.write(uint16(mat2gray(I)*2^16));
|
||||
t.close();
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user