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

fix: Channel ID and Name in display settings metadata #37

Merged
merged 2 commits into from
Aug 26, 2024
Merged
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
2 changes: 1 addition & 1 deletion _pylibCZIrw/src/api/CZIwriteAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void CZIwriteAPI::WriteMetadata(
ssName << "";
nameIsValid = false;
}
return make_tuple(ssId.str(), make_tuple(true, ssName.str()));
return make_tuple(ssId.str(), make_tuple(nameIsValid, ssName.str()));
};

auto mdBldr = this->spWriter_->GetPreparedMetadata(prepareInfo);
Expand Down
8 changes: 8 additions & 0 deletions pylibCZIrw/tests/integration/write/test_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,17 @@ def test_write_metadata_application_version_matches_package_version() -> None:
},
[
{
"@Id": "Channel:0",
"@Name": "TestCh0",
"IsSelected": "true",
"Color": "#FF010203",
"ColorMode": "Color",
"Low": "0.2",
"High": "0.8",
},
{
"@Id": "Channel:1",
"@Name": "TestCh1",
"IsSelected": "true",
"Color": "#FFFFFEFD",
"ColorMode": "Color",
Expand Down Expand Up @@ -239,6 +243,10 @@ def __flatten(setting: Union[List[OrderedDict], OrderedDict]) -> Iterator[Ordere
with tempfile.TemporaryDirectory() as td:
# Act
with create_czi(join(td, "test.czi")) as test_czi:
# Write data to the CZI since behavior on empty images in not well-defined
test_czi.write(data=np.zeros((100, 100), dtype=np.uint8), plane={"C": 0})
test_czi.write(data=np.zeros((100, 100), dtype=np.uint8), plane={"C": 1})
# Write metadata
test_czi.write_metadata(
document_name="TestWriteMetadata",
scale_x=1.0,
Expand Down
Loading