Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
e1ea590a
Commit
e1ea590a
authored
13 years ago
by
tpylak
Browse files
Options
Downloads
Patches
Plain Diff
LMS-2202 InfectX: importing segmentation images
SVN: 21203
parent
866decb0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
screening/source/java/ch/systemsx/cisd/openbis/dss/generic/server/images/ImageChannelsUtils.java
+24
-8
24 additions, 8 deletions
...openbis/dss/generic/server/images/ImageChannelsUtils.java
with
24 additions
and
8 deletions
screening/source/java/ch/systemsx/cisd/openbis/dss/generic/server/images/ImageChannelsUtils.java
+
24
−
8
View file @
e1ea590a
...
@@ -141,7 +141,7 @@ public class ImageChannelsUtils
...
@@ -141,7 +141,7 @@ public class ImageChannelsUtils
boolean
mergeAllChannels
=
utils
.
isMergeAllChannels
(
imagesReference
);
boolean
mergeAllChannels
=
utils
.
isMergeAllChannels
(
imagesReference
);
List
<
AbsoluteImageReference
>
imageContents
=
List
<
AbsoluteImageReference
>
imageContents
=
utils
.
fetchImageContents
(
imagesReference
,
mergeAllChannels
,
true
);
utils
.
fetchImageContents
(
imagesReference
,
mergeAllChannels
,
true
);
return
calculateSingleImages
(
imageContents
);
return
calculateSingleImages
(
imageContents
,
true
,
mergeAllChannels
);
}
}
private
static
RequestedImageSize
getSize
(
BufferedImage
img
,
boolean
highQuality
)
private
static
RequestedImageSize
getSize
(
BufferedImage
img
,
boolean
highQuality
)
...
@@ -412,14 +412,15 @@ public class ImageChannelsUtils
...
@@ -412,14 +412,15 @@ public class ImageChannelsUtils
}
}
/**
/**
* @param
allChannelsMerged
sometimes we can have a single image which contain all
channels
* @param
useMergedChannelsTransformation
sometimes we can have a single image which contain all
* merged. In this case a different transformation will be applied to it.
*
channels
merged. In this case a different transformation will be applied to it.
*/
*/
private
static
BufferedImage
calculateAndTransformSingleImage
(
private
static
BufferedImage
calculateAndTransformSingleImage
(
AbsoluteImageReference
imageReference
,
boolean
transform
,
boolean
allChannelsMerged
)
AbsoluteImageReference
imageReference
,
boolean
transform
,
boolean
useMergedChannelsTransformation
)
{
{
BufferedImage
image
=
calculateSingleImage
(
imageReference
);
BufferedImage
image
=
calculateSingleImage
(
imageReference
);
return
transform
(
image
,
imageReference
,
transform
,
allChannelsMerged
);
return
transform
(
image
,
imageReference
,
transform
,
useMergedChannelsTransformation
);
}
}
private
static
BufferedImage
calculateSingleImage
(
AbsoluteImageReference
imageReference
)
private
static
BufferedImage
calculateSingleImage
(
AbsoluteImageReference
imageReference
)
...
@@ -477,7 +478,10 @@ public class ImageChannelsUtils
...
@@ -477,7 +478,10 @@ public class ImageChannelsUtils
allChannelsMerged
);
allChannelsMerged
);
}
else
}
else
{
{
List
<
ImageWithReference
>
images
=
calculateSingleImages
(
imageReferences
);
// We do not transform single images here.
// The 'merged channels' transformation will be applied later.
List
<
ImageWithReference
>
images
=
calculateSingleImages
(
imageReferences
,
false
,
allChannelsMerged
);
BufferedImage
mergedImage
=
mergeImages
(
images
);
BufferedImage
mergedImage
=
mergeImages
(
images
);
// NOTE: even if we are not merging all the channels but just few of them we use the
// NOTE: even if we are not merging all the channels but just few of them we use the
// merged-channel transformation
// merged-channel transformation
...
@@ -537,13 +541,25 @@ public class ImageChannelsUtils
...
@@ -537,13 +541,25 @@ public class ImageChannelsUtils
}
}
}
}
/** @param useMergedChannelsTransformation used only if transformEachImage is true */
private
static
List
<
ImageWithReference
>
calculateSingleImages
(
private
static
List
<
ImageWithReference
>
calculateSingleImages
(
List
<
AbsoluteImageReference
>
imageReferences
)
List
<
AbsoluteImageReference
>
imageReferences
,
boolean
transformEachImage
,
boolean
useMergedChannelsTransformation
)
{
{
List
<
ImageWithReference
>
images
=
new
ArrayList
<
ImageWithReference
>();
List
<
ImageWithReference
>
images
=
new
ArrayList
<
ImageWithReference
>();
for
(
AbsoluteImageReference
imageRef
:
imageReferences
)
for
(
AbsoluteImageReference
imageRef
:
imageReferences
)
{
{
BufferedImage
image
=
calculateSingleImage
(
imageRef
);
BufferedImage
image
;
if
(
transformEachImage
)
{
image
=
calculateAndTransformSingleImage
(
imageRef
,
true
,
useMergedChannelsTransformation
);
}
else
{
image
=
calculateSingleImage
(
imageRef
);
}
images
.
add
(
new
ImageWithReference
(
image
,
imageRef
));
images
.
add
(
new
ImageWithReference
(
image
,
imageRef
));
}
}
return
images
;
return
images
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment