« 今日のxkcd | トップページ | 西大伍 代表初選出!!! »

2011年5月28日 (土)

imfinfoおせー。MATLAB2007b。

今週は数ヶ月ぶりにMATLABで仕事している。

Pythonを覚えてからはきれいで読みやすいコードを心がける癖がついて、ソースが多少縦にながくなっても変数名を分かりやすくしたり、インデントとかの整形や、データ型もuint8が使えるときはなるべくつかってメモリを最適化したりなどいろいろと良い影響がある。

MATLABはちょうどよいハイレベルな関数が用意されているときはほんとに簡単にやりたい事ができて快適。しかしないときは結構フラストレーションがたまる。

例えば、imfinfoをつかってTIFFファイルから複数のフレームを扱うような場合。MathWorksのスティーブさんのブログによると、

fname = 'my_file_with_lots_of_images.tif';
info = imfinfo(fname);
num_images = numel(info);
for k = 1:num_images
    A = imread(fname, k);
    % ... Do something with image A ...
end

なんていう、、まず何枚フレームがあるかを調べて、それだけForループしてやるなんていう典型的な処理がバージョン2007bまでは遅かったのが2008と2009に段階的に改善されたらしい。

たかだか100以下のフレームしかないファイルなのに結構おそいので、もっといい方法があるにちがいないとおもったのに、そうではないらしい。もちろん最新版なら問題ないんだろうけど、ライセンスつまりお金の関係で古いのをつかっているのでしょうがない。

(追記: 2007bでもimreadalltiffを使うと読込みが早いことに気付いた。実際に必要なのは1枚おきなので半分しか読まなくていいんだけど、そ れでも全部読んでからスライスして入らないフレームを捨てた方が断然はやい。imreadは無駄なオーバーヘッドがやたらあるらしいのでおそいらしい。)

むかしだったら、簡単に諦めがつくが、今となるとPythonだったらPILあたりをつかって簡単にできそうと思ってしまうのでわざわざ古いMATLABを使うのがほんとにベターなのだろうかと思ってしまう。Pythonのコード渡されてもこまるだろうから、同僚とコードをシェアすることができるのが唯一の利点になりつつあるな。xkcdのこれを思い出した。

« 今日のxkcd | トップページ | 西大伍 代表初選出!!! »

Python」カテゴリの記事

コメント

https://www.pandoracharmsbracelets.us.com/
https://www.nikeoutletsonline.us.com/
https://www.ultra-boost.us.com/
https://www.adidascom.us.com/
https://www.yeezyshoesboost.us.com/
https://www.airforce1s.us.com/
https://www.nmdsadidas.us.com/
https://www.trainersoutlet.uk.com/
https://www.pandorascharms.uk.com/
https://www.nikesneakersstore.us.com/
https://www.trainersstore.uk.com/
https://www.nikesrunningshoes.us.com/
https://www.pandoracharmsbracelet.us.com/
https://www.nikeoutletstore.ca/
https://www.adidasyeezys.us.com/
https://www.nike-rosherun.us.com/
https://www.shoesoutletstores.ca/
https://www.yeezyshoesstore.ca/
https://www.outletadidasshoes.us.com/
https://www.yeezyshoesadidas.us.com/
https://www.adidasoutletshoes.us.com/
https://www.nikeclearancestores.us.com/
https://www.newadidasshoes.us.com/
https://www.adidas-originalssuperstar.us.com/
https://www.officialyeezywebsite.us.com/
https://www.pandorasjewelry.uk.com/
https://www.nikepresto.us.org/
https://www.ultraboost.uk.com/
https://www.pandoras.uk.com/
https://www.nikeshoesshop.ca/
https://www.yeezyshop.us.com/
https://www.offwhite-shoes.us.com/
https://www.adidasultraboost.shop/
https://www.nikecanada-onlineshopping.ca/
https://www.pandorajewelryuk.uk.com/
https://www.adidassuperstars.us.com/
https://www.adidasstoreonline.us.com/
https://www.trainerssale.uk.com/
https://www.jewelrypandora.us.org/
https://www.nikeclearances.us.com/
https://www.adidas-superstars.us.com/
https://www.nikesoutlets.us.com/
https://www.adidasyeezyofficialwebsite.us.com/
https://pandorabracelets-charms.us.com/
https://www.nike-sneakers.us.com/
https://www.nikesstoreoutlet.us.com/
https://www.yeezysboost-350.us.com/
https://www.adidasoutletstores.us.com/
https://www.adidass.us.com/
https://www.nikeshoesoutlets.us.com/
https://www.nmd.uk.com/
https://www.nikeair-force1.us.com/
https://www.nike-onlinecanada.ca/
https://www.newtrainers.uk.com/
https://www.yeezy500boost.us.com/
https://www.nike-outletfactory.us.com/
https://www.nikeoutletstores.us.com/
https://www.adidasshoesonline.us.com/
https://www.pandorarings.uk.com/
https://www.yeezyboost350v2.us.com/
https://www.adidasshoesshop.us.com/
https://www.yeezycanadastore.ca/
https://www.yeezy350shoes.ca/
https://www.nikeoutlet--store.us.com/

https://www.pandorajewelryuk.uk.com/
https://www.nikeoutletstore.ca/
https://www.adidass.us.com/
https://www.trainersstore.uk.com/
https://www.nikeoutletstores.us.com/
https://www.shoesoutletstores.ca/
https://www.nikeoutletsonline.us.com/
https://www.nike-sneakers.us.com/
https://www.pandorascharms.uk.com/
https://www.nikeair-force1.us.com/
https://www.adidas-originalssuperstar.us.com/
https://www.adidasultraboost.shop/
https://www.adidasshoesshop.us.com/
https://www.yeezycanadastore.ca/
https://www.yeezyshop.us.com/
https://www.ultraboost.uk.com/
https://www.pandorarings.uk.com/
https://www.officialyeezywebsite.us.com/
https://www.adidasyeezys.us.com/
https://www.pandoracharmsbracelets.us.com/
https://www.offwhite-shoes.us.com/
https://www.ultra-boost.us.com/
https://www.nikesstoreoutlet.us.com/
https://www.yeezy500boost.us.com/
https://pandorabracelets-charms.us.com/
https://www.jewelrypandora.us.org/
https://www.yeezyboost350v2.us.com/
https://www.adidasyeezyofficialwebsite.us.com/
https://www.nike-rosherun.us.com/
https://www.pandorasjewelry.uk.com/
https://www.nikeclearancestores.us.com/
https://www.adidasshoesonline.us.com/
https://www.airforce1s.us.com/
https://www.nikesneakersstore.us.com/
https://www.adidasoutletshoes.us.com/
https://www.newadidasshoes.us.com/
https://www.nikepresto.us.org/
https://www.nikeclearances.us.com/
https://www.newtrainers.uk.com/
https://www.adidasstoreonline.us.com/
https://www.nikeoutlet--store.us.com/
https://www.pandoras.uk.com/
https://www.outletadidasshoes.us.com/
https://www.nmdsadidas.us.com/
https://www.trainersoutlet.uk.com/
https://www.yeezyshoesboost.us.com/
https://www.yeezyshoesadidas.us.com/
https://www.nike-onlinecanada.ca/
https://www.nikesrunningshoes.us.com/
https://www.adidas-superstars.us.com/
https://www.trainerssale.uk.com/
https://www.nikecanada-onlineshopping.ca/
https://www.adidasoutletstores.us.com/
https://www.yeezysboost-350.us.com/
https://www.nikeshoesshop.ca/
https://www.pandoracharmsbracelet.us.com/
https://www.adidascom.us.com/
https://www.adidassuperstars.us.com/
https://www.yeezy350shoes.ca/
https://www.nmd.uk.com/
https://www.nikesoutlets.us.com/
https://www.nikeshoesoutlets.us.com/
https://www.yeezyshoesstore.ca/
https://www.nike-outletfactory.us.com/

https://www.ferragamo-shoes.us.org/
https://www.menwomenshoes.us/
https://www.pandoracanadajewelrycharms.ca/
https://www.nikeairzooms.us.com/
https://www.fjallravenkankenbackpack.us/
https://www.yeezysneakersboost.us/
https://www.nikesneakerssale.us.com/
https://www.nike-runningshoes.us/
https://www.airforceones.us.com/
https://www.nikeoutletstoreonlines.us.com/
https://www.christian-louboutins.us.org/
https://www.charmsjewelryrings.uk.com/
https://www.yeezyshoess.us.com/
https://www.christian-louboutinoutletsale.us.com/
https://www.nikeshoesonlines.us.com/
https://www.nikeairmax720.us.com/
https://www.nikecortezshox.us.com/
https://www.nikeair-max270.us/
https://www.charmsbracelet.uk.com/
https://www.nikeshoes2019.us.com/
https://www.nikeshoess.us.org/
https://www.fjallravenbackpack.us/
https://www.sneakerswebsite.us/
https://www.cheapnikesshoes.us.com/
https://www.nike-presto.us.com/
https://www.nikeshoesfactorys.us.com/
https://www.airjordanssneakers.us.org/
https://www.nikefactorys.us/
https://www.nikeoutletonlineclearance.us.com/
https://www.newshoes2019.us/
https://www.yeezy500.us.org/
https://www.nike-outletstores.us.com/
https://www.shoes-yeezy.us.com/
https://www.nike--shoes.us.com/
https://www.adidasultra-boosts.us.com/
https://www.yeezys-adidas.us.com/
https://www.christianlouboutins.uk.com/
https://www.air-jordansretro.us.com/
https://www.nikeairforce.us.org/
https://www.louboutinshoess.us/
https://www.christianslouboutin.us.com/
https://www.nikeair-max.us.org/
https://www.nikeoutletstore-onlineshopping.us.org/
https://www.jewelrycharmsrings.uk.com/
https://www.redbottomslouboutinshoes.us/
https://www.asicsshoesoutlet.us.com/
https://www.yeezysboosts.us.com/
https://www.nikeoutletstoreclearance.us.com/
https://www.nikeoutletstores.us.org/
https://www.lebron16shoes.us/
https://www.pandora-jewelryrings.us/
https://www.adidas-yeezysshoes.us.com/
https://www.nikefreerun.us.org/
https://www.airjordan-retro11.us.com/
https://www.lebron17.us.org/
https://www.jordanretroshoes.us.org/
https://www.kevin-durantsshoes.us.com/
https://www.jewelrycharms.us/
https://www.adidassneakers.us.com/
https://www.jordanshoesforkids.us/
https://www.runningshoesformenwomen.us/
https://www.nikefreernrun.us.com/
https://www.christian-louboutins-shoes.us.com/
https://www.christianlouboutinshoessaleoutlet.us/
https://www.newnikeshoes.us.org/
https://www.nikefactory-outlet.us.org/
https://www.pandora-earrings.us/
https://www.jordans13retro.us/
https://www.moncleroutletuk.uk.com/
https://www.nikefactorystoreonline.us.com/
https://www.nmdr1adidas.us.com/
https://www.pandora-us.us/
https://www.ferragamobelts.us.com/
https://www.nikestores.us.org/
https://www.max97trainers.uk.com/
https://www.nikeshoesshop.us.com/
https://www.ultra-boosts.us.com/
https://www.nikeairmax720.us.org/
https://www.pandorabraceletsforwomen.us/
https://www.nikesneakersoutlet.us.org/
https://www.pandoracom.ca/
https://www.louboutinheelsshoes.us.com/
https://www.christian-louboutin-shoes.us.org/
https://www.pandoranecklaces.us/
https://www.pandoracharmscom.us/
https://www.nike-clearance.us.com/
https://www.michael-jordanshoes.us.com/
https://www.shoesyeezy.us.com/
https://www.pandorashop.ca/
https://www.jewelrynecklacerings.uk.com/
https://www.nikeoutletonline-store.us.com/
https://www.nike-zoom.us.com/
https://www.nikeshoescybermondayblackfriday.us.com/
https://www.lebron-jamesshoes.us.org/
https://www.lebronjamesshoessale.us.com/
https://www.airjordans-sneakers.us/
https://www.christianlouboutins-outlet.us.com/
https://www.nikes-sneakers.us.com/
https://www.kyrieirvingbasketballshoes.us.com/
https://www.nikeoutlet-factory.us.com/
https://www.red-bottomheels.us/
https://www.outletstoreonlineshopping.us/
https://www.nikeoutletstoreonline-shopping.us.com/
https://www.airforce-1.us.org/
https://www.kyrie-irvingshoes.us.org/
https://www.pandorabracelets-clearance.us.com/
https://www.adidasstan-smith.us.com/
https://www.nikeshoesfactorystore.us.com/
https://www.pandorajewelryofficialwebsite.us/
https://www.nike-airmax98.us/
https://www.yeezyscheap.us.com/
https://www.nikeshoesclearance.us.com/
https://www.pandorasjewelryoutlet.us.com/
https://www.adidas-nmds.us.org/
https://www.airmax-98.us.com/
https://www.air-max95.us.com/
https://www.ferragamosshoes.us.com/
https://www.nikerunning-shoes.us.com/
https://www.christianlouboutinshoessaleoutlets.us/
https://www.jordan11gammablue.us/
https://www.nikecom.us.com/
https://www.airforce1shoes.us.com/
https://www.valentinoshoessale.us.com/
https://www.redbottomshoes-forwomen.us/
https://www.nikesclearance.us/
https://www.airmax2019.us.org/
https://www.new-nikeshoes.us.com/
https://www.red-bottomshoesforwomen.us.com/
https://www.nikestorefactory.us.com/
https://www.nike-outletstoreonlineshopping.us.com/
https://www.nikebasketball-shoes.us.com/
https://www.golden-gooses.us.com/
https://www.airjordanshoesretros.us.com/
https://www.christianlouboutins.us.org/
https://www.nike-stores.us.org/
https://www.vansshoes-outlets.us.com/
https://www.lebron16shoes.us.org/
https://www.nikereactuptempo.us.com/
https://www.nikehuaraches.us.com/
https://www.nike-basketballshoes.us.org/
https://www.nikecortez.us.org/
https://www.yeezyboosts-350.us.com/

https://www.nflstores.com.co/
https://www.hockeyjerseyscheap.us.com/
https://www.nflfootballjerseysnew.us.com/
https://www.mlbbaseballjerseys.us.org/
https://www.cheapfootballjerseysfromchina.us.com/
https://www.officialfootballjerseys.us.com/
https://www.nflfanshop.com.co/
https://www.officialnfljersey.us.com/
https://www.nflgearuniforms.us/
https://www.wholesalecheapjerseysfromchina.us/
https://www.mlbshops.us.org/
https://www.jerseyswholesaleforcheap.us.com/
https://www.wholesalenbajerseyscheap.us.com/
https://www.nflfanshop.us.com/
https://www.mlbstore.us.org/
https://www.hockeyjerseyscheap.us/
https://www.nhlstore.com.co/
https://www.cheapnfljerseysfromchina.com.co/
https://www.wholesalejerseys-cheap.us.com/
https://www.cheapnbabasketballjerseys.us.org/
https://www.cheapmlbjerseyswholesale.com.co/
https://www.nfljerseysofficialshop.us/
https://www.newfootballjerseys.us.com/
https://www.cheapjerseyssale.us.org/
https://www.nflshop.com.co/
https://www.nflfootballjerseys.com.co/
https://www.nbabasketballjerseyscheap.us.com/
https://www.nflstoreonlineshopping.us/
https://www.nflshopofficial.org/
https://www.nbajerseyswholesalecheap.us.com/
https://www.mlbshops.com.co/
https://www.footballjerseysforcheap.us.com/
https://www.nbajerseysnew.us.com/
https://www.wholesalejerseyscheapest.us.com/
https://www.officialmlbstore.us.com/
https://www.wholesalenfljerseys.us.org/
https://www.baseballjerseyssale.us.com/
https://www.jerseyswholesalevip.us/
https://www.newnbajerseys.us.com/
https://www.cheapnfljerseyswholesale.com.co/
https://www.cheapjerseysfromchinawholesale.com.co/
https://www.nhljerseyscheapwholesale.us.com/
https://www.nbashop.us.org/
https://www.hockeyjerseyswholesale.us.com/
https://www.cheapnfljerseyswholesalefromchina.com.co/

https://www.nikerunning-shoes.us.com/
https://www.michael-jordanshoes.us.com/
https://www.airjordanssneakers.us.org/
https://www.adidas-nmds.us.org/
https://www.nikeshoesshop.us.com/
https://www.nike-outletstores.us.com/
https://www.yeezysneakersboost.us/
https://www.nikeairmax720.us.com/
https://www.nikefactory-outlet.us.org/
https://www.christianslouboutin.us.com/
https://www.christianlouboutinshoessaleoutlets.us/
https://www.nikeoutletstoreclearance.us.com/
https://www.nikesneakersoutlet.us.org/
https://www.nikeoutletstoreonlines.us.com/
https://www.jordans13retro.us/
https://www.airjordan-retro11.us.com/
https://www.pandorabracelets-clearance.us.com/
https://www.asicsshoesoutlet.us.com/
https://www.air-jordansretro.us.com/
https://www.nikefreernrun.us.com/
https://www.nikeoutletstoreonline-shopping.us.com/
https://www.pandora-us.us/
https://www.cheapnikesshoes.us.com/
https://www.adidasultra-boosts.us.com/
https://www.pandoranecklaces.us/
https://www.nikeoutletstore-onlineshopping.us.org/
https://www.yeezysboosts.us.com/
https://www.nikeoutlet-factory.us.com/
https://www.nikefactorystoreonline.us.com/
https://www.pandoracom.ca/
https://www.louboutinshoess.us/
https://www.nikeairforce.us.org/
https://www.christian-louboutins-shoes.us.com/
https://www.nikesneakerssale.us.com/
https://www.nikereactuptempo.us.com/
https://www.pandorabraceletsforwomen.us/
https://www.pandora-earrings.us/
https://www.runningshoesformenwomen.us/
https://www.christian-louboutinoutletsale.us.com/
https://www.jewelrynecklacerings.uk.com/
https://www.nikestorefactory.us.com/
https://www.airforce1shoes.us.com/
https://www.nikeshoes2019.us.com/
https://www.ferragamo-shoes.us.org/
https://www.adidasstan-smith.us.com/
https://www.nike-presto.us.com/
https://www.yeezys-adidas.us.com/
https://www.red-bottomshoesforwomen.us.com/
https://www.lebronjamesshoessale.us.com/
https://www.new-nikeshoes.us.com/
https://www.pandorajewelryofficialwebsite.us/
https://www.nikecortez.us.org/
https://www.nikeoutletonline-store.us.com/
https://www.pandoracanadajewelrycharms.ca/
https://www.nikeoutletonlineclearance.us.com/
https://www.nike-clearance.us.com/
https://www.nikeoutletstores.us.org/
https://www.nikeshoesonlines.us.com/
https://www.adidas-yeezysshoes.us.com/
https://www.jordanretroshoes.us.org/
https://www.red-bottomheels.us/
https://www.airjordans-sneakers.us/
https://www.christianlouboutinshoessaleoutlet.us/
https://www.yeezy500.us.org/
https://www.airforce-1.us.org/
https://www.lebron-jamesshoes.us.org/
https://www.newshoes2019.us/
https://www.fjallravenbackpack.us/
https://www.nike-zoom.us.com/
https://www.nikefactorys.us/
https://www.christianlouboutins.uk.com/
https://www.ferragamobelts.us.com/
https://www.jewelrycharms.us/
https://www.redbottomshoes-forwomen.us/
https://www.lebron16shoes.us.org/
https://www.redbottomslouboutinshoes.us/
https://www.charmsbracelet.uk.com/
https://www.nike-runningshoes.us/
https://www.nikeshoesfactorystore.us.com/
https://www.nikeairzooms.us.com/
https://www.christianlouboutins.us.org/
https://www.ultra-boosts.us.com/
https://www.nike-basketballshoes.us.org/
https://www.golden-gooses.us.com/
https://www.christian-louboutin-shoes.us.org/
https://www.charmsjewelryrings.uk.com/
https://www.yeezyshoess.us.com/
https://www.air-max95.us.com/
https://www.kevin-durantsshoes.us.com/
https://www.jewelrycharmsrings.uk.com/
https://www.nikecom.us.com/
https://www.lebron17.us.org/
https://www.nike--shoes.us.com/
https://www.louboutinheelsshoes.us.com/
https://www.shoesyeezy.us.com/
https://www.jordanshoesforkids.us/
https://www.pandorashop.ca/
https://www.nike-outletstoreonlineshopping.us.com/
https://www.christian-louboutins.us.org/
https://www.vansshoes-outlets.us.com/
https://www.moncleroutletuk.uk.com/
https://www.nikehuaraches.us.com/
https://www.nikeshoesfactorys.us.com/
https://www.airmax2019.us.org/
https://www.outletstoreonlineshopping.us/
https://www.nikebasketball-shoes.us.com/
https://www.nikeairmax720.us.org/
https://www.pandorasjewelryoutlet.us.com/
https://www.jordan11gammablue.us/
https://www.airjordanshoesretros.us.com/
https://www.kyrieirvingbasketballshoes.us.com/
https://www.nmdr1adidas.us.com/
https://www.kyrie-irvingshoes.us.org/
https://www.menwomenshoes.us/
https://www.nike-airmax98.us/
https://www.nikeair-max270.us/
https://www.pandora-jewelryrings.us/
https://www.adidassneakers.us.com/
https://www.sneakerswebsite.us/
https://www.nikeshoesclearance.us.com/
https://www.fjallravenkankenbackpack.us/
https://www.nikestores.us.org/
https://www.nikecortezshox.us.com/
https://www.nikeshoess.us.org/
https://www.airmax-98.us.com/
https://www.yeezyboosts-350.us.com/
https://www.nikeair-max.us.org/
https://www.shoes-yeezy.us.com/
https://www.max97trainers.uk.com/
https://www.newnikeshoes.us.org/
https://www.valentinoshoessale.us.com/
https://www.nikeshoescybermondayblackfriday.us.com/
https://www.christianlouboutins-outlet.us.com/
https://www.nikefreerun.us.org/
https://www.airforceones.us.com/
https://www.lebron16shoes.us/
https://www.yeezyscheap.us.com/
https://www.pandoracharmscom.us/
https://www.nikes-sneakers.us.com/
https://www.nikesclearance.us/
https://www.nike-stores.us.org/
https://www.ferragamosshoes.us.com/

コメントを書く

(ウェブ上には掲載しません)

トラックバック


この記事へのトラックバック一覧です: imfinfoおせー。MATLAB2007b。:

« 今日のxkcd | トップページ | 西大伍 代表初選出!!! »

しろののツイッタータイムライン(凍結中)

  • ツイッターは5つ目も凍結されました。6つ目での復活も不可能。なのでnoteに注力しています。

    と思ったら、イーロン・マスクの買収が公になってアカウントが復活できました。ありがとうマスク。

    トランプ関連記事の一覧リスト

オススメたち

2022年8月
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

はてブ

無料ブログはココログ