Skip to content

Commit

Permalink
Merge pull request #531 from tlambert03/better-image-tags
Browse files Browse the repository at this point in the history
make all metadata based on keywords in InsertMultiChannel
  • Loading branch information
marktsuchida authored Dec 18, 2024
2 parents af54ae9 + 2caf246 commit 9c7472c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 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
2 changes: 1 addition & 1 deletion MMCore/MMCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;


///////////////////////////////////////////////////////////////////////////////
Expand Down
8 changes: 8 additions & 0 deletions MMDevice/MMDeviceConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,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_Metadata_Exposure = "Exposure-ms";
MM_DEPRECATED(const char* const g_Keyword_Meatdata_Exposure) = "Exposure-ms"; // Typo
Expand Down

0 comments on commit 9c7472c

Please sign in to comment.