【问题标题】:cannot open tiff files compressed in this fashion (2) - imageJ/FIJI无法打开以这种方式压缩的 tiff 文件 (2) - imageJ/FIJI
【发布时间】:2013-04-12 18:24:43
【问题描述】:

我有两组从 MATLAB 生成的图像 - 一组是我从图形窗口手动保存到 tif 文件时,另一组是使用 MATLAB 中的imwrite 函数以 tif 格式保存的图像。

当我尝试使用第一组图像在斐济(图像 J)中执行某些操作时,它可以工作,但是当我尝试在第二组中执行相同操作时,我收到一条错误消息,提示“无法打开在此压缩的 tiff 文件时尚 (2)'。有没有我需要安装的插件?

第一组的 imfinfo - 由图形窗口中的 saveas tif 创建:

Filename: [1x68 char]
              FileModDate: [1x20 char]
                 FileSize: 51376
                   Format: 'tif'
            FormatVersion: []
                    Width: 719
                   Height: 477
                 BitDepth: 24
                ColorType: 'truecolor'
          FormatSignature: [1x4 double]
                ByteOrder: [1x13 char]
           NewSubFileType: 0
            BitsPerSample: [8 8 8]
              Compression: 'PackBits'
PhotometricInterpretation: 'RGB'
             StripOffsets: [69x1 double]
          SamplesPerPixel: 3
             RowsPerStrip: 7
          StripByteCounts: [69x1 double]
              XResolution: 96
              YResolution: 96
           ResolutionUnit: 'Inch'
                 Colormap: []
      PlanarConfiguration: 'Chunky'
                TileWidth: []
               TileLength: []
              TileOffsets: []
           TileByteCounts: []
              Orientation: 1
                FillOrder: 1
         GrayResponseUnit: 0.0100
           MaxSampleValue: [1x3 double]
           MinSampleValue: [0 0 0]
             Thresholding: 1
                   Offset: 50592
         ImageDescription: [1x22 char]

第二组的 imfinfo - 由 imwrite 创建。 imwrite(bw,fullfile(文件名),'tiff');

 Filename: [1x75 char]
              FileModDate: [1x20 char]
                 FileSize: 25586
                   Format: 'tif'
            FormatVersion: []
                    Width: 832
                   Height: 587
                 BitDepth: 1
                ColorType: [1x9 char]
          FormatSignature: [1x4 double]
                ByteOrder: [1x13 char]
           NewSubFileType: 0
            BitsPerSample: 1
              Compression: [1x8 char]
PhotometricInterpretation: [1x11 char]
             StripOffsets: [66x1 double]
          SamplesPerPixel: 1
             RowsPerStrip: 9
          StripByteCounts: [66x1 double]
              XResolution: 72
              YResolution: 72
           ResolutionUnit: 'Inch'
                 Colormap: []
      PlanarConfiguration: 'Chunky'
                TileWidth: []
               TileLength: []
              TileOffsets: []
           TileByteCounts: []
              Orientation: 1
                FillOrder: 1
         GrayResponseUnit: 0.0100
           MaxSampleValue: 1
           MinSampleValue: 0
             Thresholding: 1
                   Offset: 24868

【问题讨论】:

  • 你能显示用于生成这些图像的imwrite 语句吗?
  • imwrite(bw,fullfile(filename),'tiff');

标签: matlab matlab-figure imagej


【解决方案1】:

我不确定,如果你得到答案。我有一个类似的问题。尝试通过以下方式保存您的文件:

imwrite(bw,fullfile(filename),'tiff', 'Compression','none');

或尝试使用“packbits”进行压缩

imwrite(bw,fullfile(filename),'tiff', 'Compression','packbits');

【讨论】:

  • 我想通了。谢谢!
【解决方案2】:

试试这个 ImageJ 插件 - IJ Plugins: Image I/O


编辑

看起来您的图像是二进制的 (BitDepth=1)。默认情况下,IMWRITE 将二进制图像保存为 TIFF 格式并使用ccitt 压缩。 IMageJ 不支持此类图像。 (例如,出于可能的原因,请参阅此 thread)。

如果您需要使用imwrite 保存图像,请尝试将BitDepth 设置为24,将Compression 设置为packbits。比较imfinfo 输出中的其他字段,并在必要时使用imwrite 中的不同字段。

【讨论】:

  • 你能在 MATLAB 之外打开这些图像吗?还请显示这些图像的imfinfo 输出。如果您有更多信息,请更新您的问题。
  • 是的,我可以打开它们。请查看 imfinfo。我在问题中更新了它。
  • imwrite 中 packbits 的压缩参数似乎正在工作(我没有收到以前的错误)但现在它说:java.io.EOFException IJ.openImage() 返回 null: C:\Original图像数据\输入图像\71578-sample2.tif。难道我做错了什么?我现在将来自 MATLAB 的二进制 tif 图像保存为 Image J 支持的压缩中的 tiff,但是“返回 null”是什么意思?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-06-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多