Borrar filtros
Borrar filtros

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

13 visualizaciones (últimos 30 días)
mohd akmal masud
mohd akmal masud el 2 de Sept. de 2023
Comentada: Cheng el 28 de Sept. de 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 comentarios
Voss
Voss el 27 de Sept. de 2024
Movida: Voss el 27 de Sept. de 2024
writematrix(M,'a.a00','FileType','text')
where M is your matrix.
Cheng
Cheng el 28 de Sept. de 2024
Thank you

Iniciar sesión para comentar.

Respuesta aceptada

DGM
DGM el 3 de Sept. de 2023
Editada: DGM el 3 de Sept. de 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 comentarios
mohd akmal masud
mohd akmal masud el 4 de Sept. de 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 el 4 de Sept. de 2023
Editada: DGM el 4 de Sept. de 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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Images en Help Center y File Exchange.

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by