From 3edbefb5114bb7c40d736ecca625297a2b5c51e8 Mon Sep 17 00:00:00 2001
From: felmer <felmer>
Date: Thu, 17 Apr 2008 15:14:23 +0000
Subject: [PATCH] bug fixed

SVN: 5673
---
 .../systemsx/cisd/bds/hcs/HCSImageAnnotations.java  | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/bds/source/java/ch/systemsx/cisd/bds/hcs/HCSImageAnnotations.java b/bds/source/java/ch/systemsx/cisd/bds/hcs/HCSImageAnnotations.java
index ff96ebd4424..e0e1ac38664 100644
--- a/bds/source/java/ch/systemsx/cisd/bds/hcs/HCSImageAnnotations.java
+++ b/bds/source/java/ch/systemsx/cisd/bds/hcs/HCSImageAnnotations.java
@@ -63,9 +63,16 @@ public final class HCSImageAnnotations implements IAnnotations
             throw new DataStructureException("One of the following formats expected instead of '"
                     + format + "': " + FORMATS);
         }
-        final int channelCount =
-                ((Integer) formattedData.getFormatParameters().getValue(
-                        HCSImageFormatV1_0.NUMBER_OF_CHANNELS)).intValue();
+        Object value =
+                formattedData.getFormatParameters().getValue(HCSImageFormatV1_0.NUMBER_OF_CHANNELS);
+        int channelCount;
+        if (value instanceof Integer)
+        {
+            channelCount = ((Integer) value).intValue();
+        } else
+        {
+            channelCount = Integer.parseInt(String.valueOf(value));
+        }
         final int size = channels.size();
         if (channelCount != size)
         {
-- 
GitLab