Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. function [] = convertDataTo32Tiff( filename, data )
  2.  
  3. result = Tiff(filename,'w');
  4. data = im2single(data);
  5. tagstruct.ImageLength = size(data,1);
  6. tagstruct.ImageWidth = size(data,2);
  7. tagstruct.Photometric = Tiff.Photometric.MinIsBlack;
  8. tagstruct.BitsPerSample = 32;
  9. tagstruct.SamplesPerPixel = 1;
  10. tagstruct.RowsPerStrip = 1;
  11. tagstruct.PlanarConfiguration = Tiff.PlanarConfiguration.Chunky;
  12. tagstruct.Software = 'MATLAB';
  13. tagstruct.SampleFormat = 3;
  14. result.setTag(tagstruct);
  15. result.write(data);
  16. result.close();
  17.  
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement