Writing multidimensional TIFF files using imwrite
조회 수: 15 (최근 30일)
이전 댓글 표시
Hi, I'm trying to write multidimensional TIFF files (also known as "hyperstacks" in ImageJ). For example, the "dimensions" will be microscopy attributes, such as fluorescence channel, timepoint, stage position, etc. I have an example below. I tried using the imwrite "append" mode in a nested for loop but it simply created a 21x1 stack, not a 7x3 as I had hoped. Any suggestions? Thanks.
% A is 7x3 cell array containing all images
outputFileName = 'img_stack.tif'
for j = 1:3 %channel number
for i = 1:7 % timepoint
imwrite(A{i,j}, outputFileName,'writemode','append','Compression','none');
end
end
댓글 수: 1
Curtis Rueden
2017년 11월 26일
편집: Curtis Rueden
2017년 11월 26일
See also this question on StackOverflow. I recommend using the Bio-Formats library to export as OME-TIFF.
답변 (2개)
Kouichi C. Nakamura
2018년 5월 3일
I recommend to use ijmshow in conjunction with Fiji's ImageJ-MATLAB.
addpath '/Applications/Fiji.app/scripts' % depends your Fiji installation
ImageJ
imp = ijmshow(I,'YXCZT')
% I is 5D array of uint8 or uint16
% the second argument determines which dimension represents what
% imp is a 5D hyperstack
ij.IJ.saveAsTiff(imp, 'image1.tif');
댓글 수: 0
Walter Roberson
2016년 5월 3일
The information I find suggests that ImageJ parses the Tiff ImageDescription tag to determine the arrangement. I would need to study an example to determine the proper order.
imwrite() cannot write the ImageDescription tag; you would need to use the Tiff class for that.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Biomedical Imaging에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!