Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make all metadata based on keywords in InsertMultiChannel #531

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading