Saving a stack of images

8 visualizaciones (últimos 30 días)
Jason
Jason el 3 de Mzo. de 2017
Comentada: Jason el 4 de Mzo. de 2017
Hi. I have a set of tiff images in an array (expressed as an array of double).
I want to save as a stack of images. I have tried:
for k=1:mx
imgArray2(:,:,k)=imgArray{k};
end
try
imwrite(imgArray2,sprintf('%s\\%s.stk',folder,prefix));
catch
h = errordlg('Error Saving Image STK')
end
But get the error message:
Subscripted assignment dimension mismatch.
Error in myProgram>pushbutton53_Callback (line 4016)
imgArray2(:,:,k)=imgArray{k};
  5 comentarios
Walter Roberson
Walter Roberson el 3 de Mzo. de 2017
.stk appears to be Metamorph .stk files, which appear to be an extension of TIFF files. The contribution https://www.mathworks.com/matlabcentral/fileexchange/10298-tiffread2-m should be able to read .stk files. At the moment I do not know about writing .stk files.
Jason
Jason el 3 de Mzo. de 2017
Yes stk is from Metamorph. I dont need this format, just some way to collect a set of tiff images (which are doubles) and be able to save as a single file in any format. I would then later need to undo this and be able to eventually read the individual images.

Iniciar sesión para comentar.

Respuesta aceptada

Image Analyst
Image Analyst el 3 de Mzo. de 2017
Try save():
save('tiff_stack.mat', 'imgArray2');

Más respuestas (0)

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by