Skip to content

Commit

Permalink
make all metadata based on keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Dec 1, 2024
1 parent 870fdb1 commit 014f043
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
16 changes: 8 additions & 8 deletions MMCore/CircularBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,23 +282,23 @@ bool CircularBuffer::InsertMultiChannel(const unsigned char* pixArray, unsigned
auto now = std::chrono::system_clock::now();
md.PutImageTag(MM::g_Keyword_Metadata_TimeInCore, FormatLocalTime(now));

md.PutImageTag("Width",width);
md.PutImageTag("Height",height);
md.PutImageTag(MM::g_Keyword_Metadata_Width, width);
md.PutImageTag(MM::g_Keyword_Metadata_Height, height);
if (byteDepth == 1)
md.PutImageTag("PixelType","GRAY8");
md.PutImageTag(MM::g_Keyword_PixelType, MM::g_Keyword_PixelType_GRAY8);
else if (byteDepth == 2)
md.PutImageTag("PixelType","GRAY16");
md.PutImageTag(MM::g_Keyword_PixelType, MM::g_Keyword_PixelType_GRAY16);
else if (byteDepth == 4)
{
if (nComponents == 1)
md.PutImageTag("PixelType","GRAY32");
md.PutImageTag(MM::g_Keyword_PixelType, MM::g_Keyword_PixelType_GRAY32);
else
md.PutImageTag("PixelType","RGB32");
md.PutImageTag(MM::g_Keyword_PixelType, MM::g_Keyword_PixelType_RGB32);
}
else if (byteDepth == 8)
md.PutImageTag("PixelType","RGB64");
md.PutImageTag(MM::g_Keyword_PixelType, MM::g_Keyword_PixelType_RGB64);
else
md.PutImageTag("PixelType","Unknown");
md.PutImageTag(MM::g_Keyword_PixelType, MM::g_Keyword_PixelType_Unknown);

pImg->SetMetadata(md);
//pImg->SetPixels(pixArray + i * singleChannelSize);
Expand Down
8 changes: 8 additions & 0 deletions MMDevice/MMDeviceConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,16 @@ namespace MM {
const char* const g_Keyword_Closed_Position = "ClosedPosition";
const char* const g_Keyword_HubID = "HubID";

const char* const g_Keyword_PixelType_GRAY8 = "GRAY8";
const char* const g_Keyword_PixelType_GRAY16 = "GRAY16";
const char* const g_Keyword_PixelType_GRAY32 = "GRAY32";
const char* const g_Keyword_PixelType_RGB32 = "RGB32";
const char* const g_Keyword_PixelType_RGB64 = "RGB64";
const char* const g_Keyword_PixelType_Unknown = "Unknown";

// image annotations
const char* const g_Keyword_Metadata_Width = "Width";
const char* const g_Keyword_Metadata_Height = "Height";
const char* const g_Keyword_Metadata_CameraLabel = "Camera";
const char* const g_Keyword_Meatdata_Exposure = "Exposure-ms";
const char* const g_Keyword_Metadata_Score = "Score";
Expand Down

0 comments on commit 014f043

Please sign in to comment.