首页 > 其他分享 >malab把single数据保存为tif

malab把single数据保存为tif

时间:2024-07-26 19:40:39浏览次数:4  
标签:PlanarConfiguration 32 single im malab tagstruct tif size

function t = saveAsTiffSingle(X, filepath)
% https://www.cnblogs.com/lionyiss/p/9552979.html
    im = single(X);
    t = Tiff(filepath,'w');
    tagstruct.ImageLength = size(im,1);
    tagstruct.ImageWidth = size(im,2);  

    tagstruct.Photometric = 1;

    % 每个像素的数值位数,single为单精度浮点型,对于32为系统为32
    tagstruct.BitsPerSample = 32;

    tagstruct.SamplesPerPixel = 1;
%     tagstruct.RowsPerStrip = 16;
    tagstruct.PlanarConfiguration = Tiff.PlanarConfiguration.Chunky;

    tagstruct.Software = 'MATLAB';

    tagstruct.SampleFormat = 3;
    t.setTag(tagstruct)

    t.write(im);

    t.close
end

标签:PlanarConfiguration,32,single,im,malab,tagstruct,tif,size
From: https://www.cnblogs.com/hahaah/p/18326111

相关文章

  • ARCH716 Climate Sensitive Single
    ARCH716Assignment-CreatingaClimateSensitiveSingle Person Homefrom a Shipping ContainerIntroductionWhen Malcolm McLeandevelopedtheshippingcontainerinthe 1950s, he revolutionizedthe transport industry. There are somewhere betwee......
  • 【YashanDB数据库】yasdb jdbc驱动集成druid连接池,业务(java)日志中有token IDENTIFIE
    问题现象客户的java日志中有如下异常信息:问题的风险及影响对正常的业务流程无影响,但是影响druid的mergesql功能(此功能会将sql语句中的字面量替换为绑定变量,然后将替换以后的sql视为同一个,然后用做执行性能统计)问题影响的版本与yashandb版本无关问题发生原因druid源码中在......
  • 二十二、【机器学习】【非监督学习】- OPTICS (Ordering Points To Identify the Clus
    系列文章目录第一章【机器学习】初识机器学习第二章【机器学习】【监督学习】-逻辑回归算法(LogisticRegression)第三章【机器学习】【监督学习】-支持向量机(SVM)第四章【机器学习】【监督学习】-K-近邻算法(K-NN)第五章【机器学习】【监督学习】-决策树(De......
  • @singledispatch 和 @typechecked 的 PyTest 不会引发预期错误
    目标:成功通过测试用例,对于NotImplementedError中test_score_not_implemented_error()@singledispatchdefscore()的目的是提高NotImplementedError,如果当count_neg和count_pos提供的参数不匹配||时|也Tuple[i......
  • CertEnumCertificatesInStore 函数
     CertEnumCertificatesInStore函数用于枚举和读取Windows操作系统中的证书存储区中的证书。这些证书存储区是在操作系统中管理证书的地方。根据Windows操作系统的不同版本,证书存储区的位置可能会有所不同,但通常包括以下常见的存储区:当前用户的个人证书存储区:这个存......
  • 利用request + BeautifulSoup 模块批量爬取内容,实现批量获取书名对应的豆瓣评分
    文章目录代码代码解释控制台输出结果代码#-*-coding:utf-8-*-frombs4importBeautifulSoupimportrequests,time,jsonheaders={"User-Agent":"Mozilla/5.0(WindowsNT10.0;Win64;x64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/79.0.394......
  • 入门到精通rsync和inotify
    rsync作用:实现文件的备份备份位置可以是当前主机,也可以是远程主机备份过程可以是完全备份,也可以是增量备份功能:1)类似于cp的复制功能将本地主机的一个文件复制到另一个位置下2)将本地主机的文件推送到远程主机:也可以是从远程主机拉取文件到本地使用模式:shell模......
  • 使用 beautifulsoup python 更改内部标签的文本
    我想更改使用Beautifulsoup获得的HTML中标签的内部文本。示例:<ahref="index.html"id="websiteName">Foo</a>变成:<ahref="index.html"id="websiteName">Bar</a>我已经设法通过其id获取标签:HTMLDocument.find(id......
  • Beautifulsoup:.find() 和 .select() 之间的区别
    当您使用BeautifulSoup抓取网站的某个部分时,您可以使用soup.find()和soup.findAll()或soup.select().find()和||之间有区别吗?|方法?(例如在性能或灵活性等方面)或者它们是相同的吗?.selec......
  • 如何在使用 Beautifulsoup 抓取时删除多个空行
    我的代码输出多个空换行符。我如何删除所有空白?frombs4importBeautifulSoupimporturllib.requestimportreurl=input('enterurlmoish')page=urllib.request.urlopen(url)soup=BeautifulSoup(page,'lxml')all=soup.find_all('a',{'cla......