Effacer les filtres
Effacer les filtres

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

5 vues (au cours des 30 derniers jours)
mohd akmal masud
mohd akmal masud le 2 Sep 2023
Modifié(e) : DGM le 4 Sep 2023
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 commentaires
mohd akmal masud
mohd akmal masud le 3 Sep 2023
Its created by SIMIND Monte Carlo program.
DGM
DGM le 3 Sep 2023
The .hxx files are obviously plaintext header files, but I don't know about the format spec for the others.

Connectez-vous pour commenter.

Réponse acceptée

DGM
DGM le 3 Sep 2023
Modifié(e) : DGM le 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 commentaires
mohd akmal masud
mohd akmal masud le 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 le 4 Sep 2023
Modifié(e) : DGM le 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.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Convert Image Type dans Help Center et File Exchange

Produits


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by