首页 > 解决方案 > 调整 FIB/SEM 图像中的图像对比度 - 不影响图像底部的文本栏

问题描述

FIB/SEM 图像在图像底部有一个文本栏。导入 GMS 时,任何对比度、伽玛、.. 调整也会影响文本栏。

是否可以分解图像并让数据处理仅影响实际图像 - 而不是文本栏?

标签: dm-script

解决方案


您可以在这里做的最好的事情是将实际图像数组分解为 2 个单独的图像,然后将文本栏部分显示为单独的 imageDisplay,您可以将其添加到数据的 imageDisplay 上。您可以相对于彼此移动/缩放它们,还可以锁定添加的显示,使其不再被鼠标移动。以下示例应该满足您的需要:

void CropAndMerge(Image img, number h){
         number sx = img.ImageGetDimensionSize(0)
         number sy = img.ImageGetDimensionSize(1)
         image data := img.slice2(0,0,0,0,sx,1,1,sy-h,1).ImageClone()     // note ":=", we sub-slice keeping tags and all
         image anno = img.slice2(0,sy-h,0,0,sx,1,1,h,1) // note "=", we just want the data copy
         
         
         imageDisplay disp 
         // Simple way to get imageDisplay. First show, then grab
         //       data.ShowImage()
         //       disp = data.ImageGetImageDisplay(0)
         
         // Better alternative: No need to show
         imageDocument doc = NewImageDocument( img.ImageGetName() )
         doc.ImageDocumentAddImage( data )
         //       doc.ImageDocumentAddImage( anno )    // Use this to add 'side ordered' in case of page-view type. However, I'd rather not use page-mode.
         disp = data.ImageGetImageDisplay(0)
         disp.ImageDisplaySetColorTableByName( "Black Body Extended" )    // Just to show you can act on the display before actually showing it that way
         
         // Add Annotation area as annotation on imageDisplay (all are components)
         imageDisplay annoDisp = NewImageDisplay( anno, "best" )
         disp.ComponentAddChildAtEnd( annoDisp )
         
         // move out of the way
         // ComponentPositionAroundPoint: Moves the annotation so the 'rel_x' horizontal point in the bounding rect is at 'new_x' (if bool horz is true), and for y accordinglye
         number doVert = 1
         number rel_y = 1.0 // bottom (relative coordinate!)
         number new_y = sy  // becomes bottom (absolute position)
         annoDisp.ComponentPositionAroundPoint( 0,new_y,0,rel_y,0,doVert)
         
         // make sure nobody messes with the annotation area
         annoDisp.ComponentSetSelectable(0)
         
         doc.ImageDocumentShow()
}

number sx = 1024
number sy = 1024
number h = 300
image in := realimage("Imported",4,sx,sy)
in = (icol%100 + iradius*sin(irow/iheight*5*Pi() + itheta )**2)
in.slice2(0,sy-h,0,0,sx,1,1,h,1) = (icol+irow)%50>45?max(in)+100:0
//in.showimage()

CropAndMerge(in.imageClone(),h)

推荐阅读