ImageJ,AUsefulToolforImageProcessingandAnalysisImageJ,图像处理与分析的得手利器JoelB.SheffieldTempleUniversity天普大学DedicatedtothememoryofDanH.Moore(1909-2008)Presentedatthe2008meetingoftheMicroscopyandMicroanalyticalSocieties提供于显微学和微量分析协会2008年年会WhyImageProcessing?为什么进行图像处理?Toimprovetheappearanceoftheimage.为了改善图像的视觉效果Tobringoutobscuredetailsinanimage.为了展现图像中不易察觉的细节Tocarryoutquantitativemeasurements为了实现定量测量PartI.IntroductiontoImageJ简介History历史Advantages优势Resources资源MacbiophotonicsMailingList邮件列表Wiki百科BurgerandBurgeBasicMenuStructure基本菜单结构PartII–SpecialIssues专题问题Operationsonallpixelsinanimage操作图像中所有像素点Thehistogram直方图Brightness亮度Contrast对比度LookUpTables查阅表RGBcolor红绿蓝色彩AspectsofAnalysisofanImage图像分析的诸多方面Measurement度量Calibration校准AreasandDensities区域和密度ConfocalSeries共聚焦系列BandpassFilter带通过滤器•AnadaptationofNIHimagefortheJavaplatform.美帝国家卫生研究院基于Java平台的图像分析软件•CanrunonanycomputersystemsthatcanrunJava(SunMicrosystems)任何能够运行Java的计算机系统均可运行本软件•Opensource开源•Twopowerfulscriptinglanguages两种强大的脚本语言–JavaPluginsJava插件–MacroLanguage宏语言•ContinualUpgrades可持续升级•Activecommunityofseveralthousandusers数万活跃用户Resources资源ImageJWebSiteImageJ的网站为:::(arealbook!实体书):DigitalImageProcessing,AnAlgorithmicIntroductionusingJava;SpringerVerlag,2008IntroductiontotheMainMenu主菜单简介Ofthese,we’llconcentrateon:当然,我们将聚焦于:–Image图像菜单–Process处理菜单–Analyze分析菜单–Plugins插件菜单–Help帮助菜单ImageMenu图像菜单ProcessMenu处理菜单AnalyzeMenu分析菜单PluginsMenu插件菜单HelpMenu帮助菜单LogScale对数坐标轴Thehistogramshowsthenumberofpixelsofeachvalue,regardlessoflocation.Thelogdisplayallowsforthevisualizationofminorcomponents.Notethatthereareunusedpixelvalues直方图展示像素点值的数量,忽略其位置。日志文本允许微量组分的可视化。注意,有未使用的像素值。TheImageHistogram图像直方图Inthiscase,thelogdisplayindicatesthatvirtuallyallpixelvaluesareused,eventhoughtheyareasmallpercentageofthetotal.本例中,日志文本表明几乎所有像素值都已使用,即使所占总体比例很小。BrightnessAdjustment亮度调节Thebrightnessadjustmentessentiallyaddsorsubtractsaconstanttoeverypixel,causingashiftinthehistogramalongthexaxis,butnochangeinthedistribution亮度调节本质上对每一像素点加或减一个常数,使得直方图在横轴上变化,但分布不变。ContrastEnhancement对比度增强Forcontrastenhancement,alowervalue,inthiscase,88,issetatzero,andahighervalue,166,issetat255.Thevaluesofeachofthepixelsareadjustedproportionately.Notethatbecauseoftheintegervalues,notallofthepixelvaluesareused.对于对比度增强,一较低值,本例中为88,被设为0;而一较高值,166,被设为255。每一像素点的值都按比例调整。注意,由于数据是整数,因此并没有使用所有的像素值。Look-UpTables查阅表8-bitimageshavenoinherentcolorvalues.Wenormallyassignvaluestoeachofthepixelsaccordingtoatable.Becauseofearlierdisplaydevices,thesevalueswereshadesofgray.Asdisplaysimproved,itbecamepossibletoassignspecificcolorstogivenvalues.InImageJ,therearethreerepresentationsofLUTs.8-bit图像没有固有的颜色值。我们一般根据表对每一像素点赋值。由于早期显示设备的限制,这些值是灰色阴影。就像演示所证明的,将特定颜色赋给给定值成为可能。在ImageJ中,有3个LUT的表示法。Sincesomeoftheseimages,suchasafluorescencemicrographareofcoloredobjects,itisusefultoapplyacolorLUTtomatchtheexpectedimage,ortoenhanceit,evenifthecamerawasmonochrome.对于部分图像,例如有颜色物体的荧光显微照片,将颜色查阅表与目标图像相匹配或增强图像是有助益的,即使相机是单色的。Theotherwaytotreatcoloristoassignasetof3values,forRed,GreenandBluetoeachpixel.Forcommoncolorimages,eachofthethreecolorsisrepresentedasan8-bitvalue.对待颜色的另一种方法是为每一个像素分配一组3色值,红、绿、蓝。对于一般的彩色图像,每一色是用一个8-bit值来表示的。Onecanthinkofacolorimageasconsistingofthreeplanes,oneforeachoftheprimarycolors可以将一幅彩色图像看作是由3幅原色图像叠加所合成的。Aswemovethecursoroverdifferentpartsoftheimage,thecolorvaluesappearinthestatusbaroftheprogram.当我们将鼠标移到图像的不同部位,颜色值将显示在程序的状态栏。Acolorhistogramisavailable,IntheAnalyzeToolsMisc.menu可以查阅颜色直方图,在Analysis→Tool→Misc菜单中。Selectanareathatistobewhite.Determinetheadjustmentsnecessaryforeachchannel,andusetheRGBRecolorplugintobalancethevalues选中白色区域。确定每一通道必要的调整措施,并使用RGBRecolor插件平衡数据。Adjustbrightnessandcontrast调整亮度和对比度Thiscanbeusedtocorrectwhitebalanceinmicrographs这可用于纠正显微照片的白平衡Conversiontogreyscale转换到灰度等级Sincemanyoperationswillworkonlyongreyscaleimages,itisnecessarytoconsiderhowtheconversionsfromcolorimagescanbeaccomplished.Therearetwoapproaches,dependentonthetypeofimage.由于许多操作只能在灰度图像上完成,明确如何转换彩色图像是十分必要的。有两种方法,取决于图像类型。Thesimplestistoselecttheimage,gotoImagetype,andselect8-bit,or16or32bit.最简单的方法是选中图像,然后到Image→type,选择8-bit或16、32bit。However,someimages,suchasfluorescencemicrographstakenasRGBimages,canyieldsurprises.然而,某些图像,例如RGB图像下获得的荧光显微照片,会产生令人意外的结果。Thereasonthattheimageissodarkisthattheroutineaveragesthethreechannels(rgb)togeneratetheimage.Sincethereisnodataingorb,thevaluesfortheredchannelaredividedby3,yieldingadarkimage.图像如此灰暗的原因是程序将颜色值平均分入3个通道(RGB)生成图像。由于G和B的数据为空,红色通道的值被一分为三,估产生灰暗图像。Wecanovercomethisbyseparatingthethreechannelsanddiscardingthosewithnodata.我们可以通过分隔3通道并忽略没有数据的地方来克服这一缺陷。Becauseofthereductioninvaluesinthe8-bitconversion,therearefewervaluesinthehistogram.由于在8-bit转换过程中数据量的减少,可以看到直方图上较少的数据量。8-bitChannelseparationComparethetwo8-bitimages,aftercorrectionforbrightness请比较亮度矫正后的两幅8-bit图像Somecamerasgeneratergbimagesevenofsinglecolorfluorescence.Inthatcase,theimageshavetobeconvertedto8-bitbeforeprocessing.某些相机即使在单色荧