필터 지우기
필터 지우기

To write a single datatype image in .tif format.

조회 수: 5 (최근 30일)
banikr
banikr 2019년 6월 12일
댓글: banikr 2019년 6월 13일
I am trying to save an image without changing it's single data type and in .tif format. I have tried Matlab TIFF function and it worked good for int32 images. But it doesn't work with single type I figure. Also, when I tried to use simple imwrite function, it errored because single type must be converted to double. But when I change to double, I lose the image data as double scales the image to 255.
Would be great help if any hack suggested.

답변 (1개)

Walter Roberson
Walter Roberson 2019년 6월 13일
  댓글 수: 1
banikr
banikr 2019년 6월 13일
Hey @Walter Roberson,
I just found the solution in the TIFF function. There is a function parameter called tagStruct.SampleFormat, which is 2 for int32 and all and 3 for single data type. Changing that from 2 to 3 worked really fine.
But I will also check the link you've provided. Thanks a lot.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Image Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by