我不能絕對確定,但它不太可能讓Matlab增加一個隱藏的品牌。
根據tiff格式標準,向tif
文件添加隱藏品牌,不會導致tiff閱讀器軟件失敗。
參考私人標籤部分:
開發人員可以申請「私人標籤」的方框,使他們能夠有一個TIFF文件中自己的專有信息不會引起問題的文件交換。 TIFF讀者需要,忽視了他們不認識的標籤,並註冊開發者的私有標籤保證不會與其他任何人的標籤或一組標準的規範中定義的標籤交鋒......
它看起來就像您使用的CT圖像軟件不符合tiff標準。
它可能(但不太可能)該軟件符合tiff的舊版本(版本5.0而不是版本6.0)。
失敗的一個原因可能是,Matalb創建了非常大的條帶,並且不遵循8K字節的建議。
參見https://www.itu.int/itudoc/itu-t/com16/tiff-fx/docs/tiff6.pdf:不推薦
一個單個條帶的用途。選擇RowsPerStrip,即使數據未被壓縮,每個帶也是大約8K字節的 ,因爲它爲讀者提供了更簡單的緩衝 。 「8K」值相當隨意,但似乎運作良好。
檢查下面的代碼(我已經發布here):
%Simulate large image (to be saved as tiff later)
I = imread('peppers.png');
I = repmat(I, [4, 4]);
t = Tiff('I.tif', 'w');
width = size(I, 2);
height = size(I, 1);
rows_per_strip = 1; %Select 1 row per strip (assume image row is less then 8K bytes).
setTag(t, 'ImageLength', height)
setTag(t, 'ImageWidth', width)
setTag(t, 'Photometric', Tiff.Photometric.RGB)
setTag(t, 'BitsPerSample', 8)
setTag(t, 'SamplesPerPixel', 3)
setTag(t, 'RowsPerStrip', rows_per_strip)
setTag(t, 'PlanarConfiguration', Tiff.PlanarConfiguration.Chunky)
%setTag(t, 'Compression', Tiff.Compression.LZW)
setTag(t, 'Compression', Tiff.Compression.None) %Try without compression
n_strips = ceil(height/rows_per_strip); %Total number of strips.
h = waitbar(0, 'In process');
%Write the tiff image strip by strip (and advance the waitbar).
for i = 1:n_strips
y0 = (i-1)*rows_per_strip + 1; %First row of current strip.
y1 = min(y0 + rows_per_strip - 1, height); %Last row of current strip.
writeEncodedStrip(t, i, I(y0:y1, :, :)) %Write strip rows y0 to y1.
waitbar(i/n_strips, h); %Update waitbar.
drawnow %Force GUI refresh.
end
close(t)
close(h)
可能有很多其他的原因失敗,因爲TIFF格式是非常複雜的(尤其是從閱讀器側)。
作爲解決方法,** ImageMagick **將忽略或抑制不需要的TIFF標籤,並且您可以安排它在一個簡單的腳本中並行重寫多個TIFF圖像。此外,你可以使用它的'identify'程序來檢查你的文件,看看*品牌*是什麼 - 使用'identify -verbose someImage.tif',或者如果你有v7或更新的版本,用'magick ... ' –
如果你安裝'libtiff' - 我使用** homebrew **在Mac上做的 - 你會得到一個名爲'tiffdump'的程序,它也會告訴你關於TIF文件的所有信息。 –
如果專有軟件限制了您的研究,您總是可以選擇另一種選擇:開源。對於二維CT重建和三維重建(我認爲這是你的情況,因爲'.tif'),我相信很多免費軟件是ASTRA和TIGRE的好選擇。兩者都可以重建CT機器的圖像。免責聲明:我編程了TIGRE。 –