help with metadata

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

help with metadata

Justine Barbier
Hello, 
I try to use Octave for the first time and I need help with metadata. I want to create a new image from an already existing image (format .png). I need to keep the metadata of the old image to the new image. My problem is that some metadata are missing. 
I use this command with matlab : 
Img_info = imfinfo([path]);
OtherInfo=Img_info.OtherText;
C1=char(OtherInfo(1,2));
C2=char(OtherInfo(2,2));
C3=char(OtherInfo(3,2)); 

C1, C2 ... represent the metadata I need to keep and it contains some information like that : <Well><WellPosition Type="System.Int32">1</WellPosition></Well>

But with octave, when I use imfinfo, I can't find the value OtherText or something equivalent. 
Is it normal ? 
I try to use fileread, I can read the data but I don't how to save it on the new image ? With imwrite for example I want to add other parameters than this one : https://www.gnu.org/software/octave/doc/interpreter/Loading-and-Saving-Images.html

I would like to have something like that : 
imwrite(Img_new,['C:\Users\u101362\Pictures\ImageTest\Controle\I_test249.png'],'Parameters',C1);
But when I try this (which works in matlab) I have the following error : invalid PARAMETER 'Parameters'. But I can't find something else...

Thank in advance for your help.

Justine

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: help with metadata

Avinoam
Justine Barbier wrote
Hello,
I try to use Octave for the first time and I need help with metadata. I
want to create a new image from an already existing image (format .png). I
need to keep the metadata of the old image to the new image. My problem is
that some metadata are missing.
I use this command with matlab :
Img_info = imfinfo([path]);
OtherInfo=Img_info.OtherText;
C1=char(OtherInfo(1,2));
C2=char(OtherInfo(2,2));
C3=char(OtherInfo(3,2));

C1, C2 ... represent the metadata I need to keep and it contains some
information like that : <Well><WellPosition Type="System.Int32">1</
WellPosition></Well>

But with octave, when I use imfinfo, I can't find the value OtherText or
something equivalent.
Is it normal ?
I try to use fileread, I can read the data but I don't how to save it on
the new image ? With imwrite for example I want to add other parameters
than this one :
https://www.gnu.org/software/octave/doc/interpreter/Loading-and-Saving-Images.html

I would like to have something like that :
imwrite(Img_new,['C:\Users\u101362\Pictures\ImageTest\Controle\I_test249.png'],'Parameters',C1);
But when I try this (which works in matlab) I have the following error :
invalid PARAMETER 'Parameters'. But I can't find something else...

Thank in advance for your help.

Justine

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
It seems that you are using undocumented features of Matlab.
The OtherText field is not documented in imfinfo [1], although the example in [2] shows this field. 'Parameters' option is not documented in imwrite [3].
Is it possible to read and write the metadata with documented features of Matlab?

[1] [https://www.mathworks.com/help/matlab/ref/imfinfo.html]
[2] [https://blogs.mathworks.com/steve/2014/09/10/image-file-information-using-imfinfo]
[3] ]https://www.mathworks.com/help/matlab/ref/imwrite.html