How to open files .ict, .hct. a00, .h00

13 views (last 30 days)
mohd akmal masud
mohd akmal masud on 2 Sep 2023
Commented: Cheng on 28 Sep 2024
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.
  8 Comments
Voss
Voss on 27 Sep 2024
Moved: Voss on 27 Sep 2024
writematrix(M,'a.a00','FileType','text')
where M is your matrix.

Sign in to comment.

Accepted Answer

DGM
DGM on 3 Sep 2023
Edited: DGM on 3 Sep 2023
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 Comments
mohd akmal masud
mohd akmal masud on 4 Sep 2023
let say my data as attached, then how to open?
I tried as below command but got error
sz = [128 128 128];
fname = 'test_tot_w1.h00';
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);
Error using reshape
Number of elements must not change. Use [] as one of the size inputs to automatically calculate the appropriate size for that
dimension.
DGM
DGM on 4 Sep 2023
Edited: DGM on 4 Sep 2023
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.

Sign in to comment.

More Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Products


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!