Skip to content

Commit 6880807

Browse files
committed
Re-added ability to generate channel image
1 parent 3050f40 commit 6880807

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "biquinho"
3-
version = "0.2.3"
3+
version = "0.2.4"
44
edition = "2021"
55
description = ""
66

src/imc.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -1191,8 +1191,16 @@ impl IMCDataset {
11911191
let mut image_map = HashMap::new();
11921192

11931193
for acquisition in self.mcd.acquisitions() {
1194-
let data = acquisition.channel_image(identifier, None)?;
1195-
image_map.insert(acquisition.id(), ChannelImage(data));
1194+
match acquisition.channel_image(identifier, None) {
1195+
Ok(data) => {
1196+
image_map.insert(acquisition.id(), ChannelImage(data));
1197+
}
1198+
Err(MCDError::InvalidChannel { channel: _ }) => {
1199+
// This channel doesn't exist for this acquisition (can happen sometimes if the panel was changed),
1200+
// so we just ignore this error
1201+
}
1202+
Err(error) => return Err(error),
1203+
}
11961204
}
11971205

11981206
Ok(image_map)

0 commit comments

Comments
 (0)