From 014f0437008da2bc906a9a8aa14fbd4040f97adf Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sun, 1 Dec 2024 17:52:19 -0500 Subject: [PATCH 1/2] make all metadata based on keywords --- MMCore/CircularBuffer.cpp | 16 ++++++++-------- MMDevice/MMDeviceConstants.h | 8 ++++++++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/MMCore/CircularBuffer.cpp b/MMCore/CircularBuffer.cpp index e23ea89b3..2453bda49 100644 --- a/MMCore/CircularBuffer.cpp +++ b/MMCore/CircularBuffer.cpp @@ -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); diff --git a/MMDevice/MMDeviceConstants.h b/MMDevice/MMDeviceConstants.h index 62aa53ce6..442d5205b 100644 --- a/MMDevice/MMDeviceConstants.h +++ b/MMDevice/MMDeviceConstants.h @@ -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"; From 2caf246d28fd28c81ad37ef3cf77b73b2e5356e8 Mon Sep 17 00:00:00 2001 From: "Mark A. Tsuchida" Date: Wed, 18 Dec 2024 16:12:54 -0600 Subject: [PATCH 2/2] Bump MMCore minor version for new constants --- MMCore/MMCore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MMCore/MMCore.cpp b/MMCore/MMCore.cpp index 7735b5257..19dd2b0cb 100644 --- a/MMCore/MMCore.cpp +++ b/MMCore/MMCore.cpp @@ -112,7 +112,7 @@ * (Keep the 3 numbers on one line to make it easier to look at diffs when * merging/rebasing.) */ -const int MMCore_versionMajor = 11, MMCore_versionMinor = 2, MMCore_versionPatch = 1; +const int MMCore_versionMajor = 11, MMCore_versionMinor = 3, MMCore_versionPatch = 0; ///////////////////////////////////////////////////////////////////////////////