【问题标题】:Query the image data type in DigitalMicrograph script在 DigitalMicrograph 脚本中查询图像数据类型
【发布时间】:2014-11-06 00:52:41
【问题描述】:

如何使用数码显微照片 (DM) 脚本查询图像数据类型和大小?我想知道图像是有符号还是无符号、实数还是整数、像素大小等。

【问题讨论】:

    标签: image-processing dm-script


    【解决方案1】:

    有一些命令可以将此信息作为返回值返回,还有一些命令查询特定类型。您可以在以下 F1 帮助部分中找到命令:

    下面是一些示例代码:

    number byteIN = 4
    number sx = 10, sy = 10
    image test := RealImage( "Test", byteIN, sx, sy )
    
    // General commands
    number dataTypeEnum = test.ImageGetDataType()
    Result( "Image is of data type " + dataTypeEnum + ".\n" )
    
    number byte = test.ImageGetDataElementByteSize()
    number bits = test.ImageGetDataElementBitSize()
    Result( "Image has " + byte +" bytes/pixel ( =" + bits + "bits/pixel )\n" )
    
    // Some specific commands (there are more), all return Boolean
    if ( test.ImageIsDataTypeFloat() ) 
        Result( "Image is a real image.\n" )
    
    if ( test.ImageIsDataTypeInteger() ) 
        Result( "Image is an integer image.\n" )
    
    if ( test.ImageIsDataTypeBinary() ) 
        Result( "Image is a binary image.\n" )
    
    if ( test.ImageIsDataTypeComplex() ) 
        Result( "Image is a complex image.\n" )
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-19
      • 1970-01-01
      • 2012-04-23
      • 1970-01-01
      • 2014-01-31
      • 1970-01-01
      相关资源
      最近更新 更多