Edit metadata in .tif file

12 Ansichten (letzte 30 Tage)
Tushare
Tushare am 15 Jul. 2013
Hello all,
I'm pretty new to matlab and am still learning, but I have encountered a problem with imwrite. I have a stacked tif file generated in the software metamorph. The images are of cells. The stack often drifts in x-y and another student wrote an alignment script that uses imwrite to create a new aligned stack. The problem is that the new stack has no metadata associated with it. I've tried to use imfinfo to create a variable with the correct info and apply it to the new stack. I've only succeeded to change the ImageDescription with a short word. For example ImageDescription: 'ainfo'.
Filename: [1x30 char]
FileModDate: '15-Jul-2013 13:03:53'
FileSize: 2019425
Format: 'tif'
FormatVersion: []
Width: 1004
Height: 1002
BitDepth: 16
ColorType: 'grayscale'
FormatSignature: [73 73 42 0]
ByteOrder: 'little-endian'
NewSubFileType: 2
BitsPerSample: 16
Compression: 'Uncompressed'
PhotometricInterpretation: 'BlackIsZero'
StripOffsets: [251x1 double]
SamplesPerPixel: 1
RowsPerStrip: 4
StripByteCounts: [251x1 double]
XResolution: []
YResolution: []
ResolutionUnit: 'None'
Colormap: []
PlanarConfiguration: 'Chunky'
TileWidth: []
TileLength: []
TileOffsets: []
TileByteCounts: []
Orientation: 1
FillOrder: 1
GrayResponseUnit: 0.0100
MaxSampleValue: 65535
MinSampleValue: 0
Thresholding: 1
Offset: 2012024
ImageDescription: [1x5137 char]
Software: 'MetaSeries'
DateTime: '20130626 20:00:31.67'
To:
Filename: [1x31 char]
FileModDate: '15-Jul-2013 12:53:37'
FileSize: 525226
Format: 'tif'
FormatVersion: []
Width: 512
Height: 512
BitDepth: 16
ColorType: 'grayscale'
FormatSignature: [73 73 42 0]
ByteOrder: 'little-endian'
NewSubFileType: 0
BitsPerSample: 16
Compression: 'Uncompressed'
PhotometricInterpretation: 'BlackIsZero'
StripOffsets: [32x1 double]
SamplesPerPixel: 1
RowsPerStrip: 16
StripByteCounts: [32x1 double]
XResolution: 72
YResolution: 72
ResolutionUnit: 'Inch'
Colormap: []
PlanarConfiguration: 'Chunky'
TileWidth: []
TileLength: []
TileOffsets: []
TileByteCounts: []
Orientation: 1
FillOrder: 1
GrayResponseUnit: 0.0100
MaxSampleValue: 65535
MinSampleValue: 0
Thresholding: 1
Offset: 524762
ImageDescription: 'ainfo'
What I'd like to is take the imfinfo from the orginal stack (or to start an original single frame image) and apply it to the new image/stack. I've tried things like:
ainfo = imfinfo('a.tif'); t = Tiff('a.tif', 'r+'); tagStruct.ImageDescription = ainfo ; t.setTag(tagStruct)
But I seem to be doing something wrong.
Any help is much appreciate and if more info is needed to help me out please let me know.
Thanks
if true
% code
end

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by