How to open files .ict, .hct. a00, .h00
38 次查看(过去 30 天)
显示 更早的评论
Dear all,
I have four types of documents, as attached.
Anyone can help e ho to open/view this files?
all the file is images.
5 个评论
DGM
2023-9-3
The .hxx files are obviously plaintext header files, but I don't know about the format spec for the others.
采纳的回答
DGM
2023-9-3
编辑:DGM
2023-9-3
Here.
sz = [128 128 128];
fname = 'point1.ict';
fid = fopen(fname);
data = fread(fid,'*uint16'); % assuming uint
fclose(fid);
% this is blindly devectorized
% may still be transposed, but i can't tell due to symmetry
% note that data is binarized on a [0 1000] scale in uint16
% so if viewing in a denormalized manner, it'll just appear black
% normalize or rescale it as needed
data = reshape(data,sz);
View as necessary (it's a 3D volumetric image)
The second image is simply a single-precision 3-channel image (RGB?)
sz = [128 128 3];
fname = 'point1_air_w1.a00';
fid = fopen(fname);
data = fread(fid,'*float'); % assuming uint
fclose(fid);
% this is blindly devectorized
% may still be transposed, but i can't tell due to symmetry
% note that data is unit-scale single-precision float
data = reshape(data,sz);
How did I know what the parameters were? I just read the header file and entered those values. Consider the first image. These are the relevant lines:
!total number of images := 128
!matrix size [1] := 128
!matrix size [2] := 128
!matrix size [3] := 128
!number of bytes per pixel := 2
!number format := unsigned integer
And the second file:
!total number of images := 3
!matrix size [1] := 128
!matrix size [2] := 128
!number format := short float
!number of bytes per pixel := 4
You could write a giant pile of regex to extract the relevant information from the headers to allow the images to be processed automatically, but with only two examples and no specifications, I'm not going to assume I know what to expect of the header formatting or the meaning of the fields.
6 个评论
DGM
2023-9-4
编辑:DGM
2023-9-4
As that header indicates, the image size should be [128 128 64]
You need to check each header file to determine the image size for the corresponding data file.
If for some reason (e.g. a common sensor resolution) all the page geometries can be assumed identical, then you can possibly use a slack dimension to avoid the lookup each time.
data = reshape(data,128,128,[]);
That would allow you to reshape any image with 128x128 page geometry, without needing to know how many slices there were.
Otherwise, a more robust automated approach would require parsing the header files.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Convert Image Type 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!