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
fd849b5b
Commit
fd849b5b
authored
13 years ago
by
tpylak
Browse files
Options
Downloads
Patches
Plain Diff
minor: API test program
SVN: 22334
parent
84574945
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/plugin/screening/client/api/v1/LoadImagesScreeningClientApiTest.java
+23
-5
23 additions, 5 deletions
...ening/client/api/v1/LoadImagesScreeningClientApiTest.java
with
23 additions
and
5 deletions
screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/api/v1/LoadImagesScreeningClientApiTest.java
+
23
−
5
View file @
fd849b5b
...
@@ -29,6 +29,7 @@ import java.util.Properties;
...
@@ -29,6 +29,7 @@ import java.util.Properties;
import
org.apache.log4j.PropertyConfigurator
;
import
org.apache.log4j.PropertyConfigurator
;
import
ch.systemsx.cisd.openbis.plugin.screening.client.api.v1.ScreeningOpenbisServiceFacade.IImageOutputStreamProvider
;
import
ch.systemsx.cisd.openbis.plugin.screening.client.api.v1.ScreeningOpenbisServiceFacade.IImageOutputStreamProvider
;
import
ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.ImageDatasetMetadata
;
import
ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.ImageDatasetReference
;
import
ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.ImageDatasetReference
;
import
ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.PlateIdentifier
;
import
ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.PlateIdentifier
;
import
ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.PlateImageReference
;
import
ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.PlateImageReference
;
...
@@ -69,7 +70,8 @@ public class LoadImagesScreeningClientApiTest
...
@@ -69,7 +70,8 @@ public class LoadImagesScreeningClientApiTest
// Another way: PlateIdentifier.createFromAugmentedCode("/SPACE_CODE/MY_PLATE_CODE")
// Another way: PlateIdentifier.createFromAugmentedCode("/SPACE_CODE/MY_PLATE_CODE")
// PlateIdentifier plate = new PlateIdentifier("MY_PLATE_CODE", "SPACE_CODE", null);
// PlateIdentifier plate = new PlateIdentifier("MY_PLATE_CODE", "SPACE_CODE", null);
PlateIdentifier
plate
=
new
PlateIdentifier
(
"PLATE-2-A"
,
"TEST"
,
null
);
String
plateCode
=
"PLATE2"
;
// "PLATE-2-A";
PlateIdentifier
plate
=
new
PlateIdentifier
(
plateCode
,
"TEST"
,
null
);
List
<
ImageDatasetReference
>
imageDatasets
=
List
<
ImageDatasetReference
>
imageDatasets
=
facade
.
listRawImageDatasets
(
Arrays
.
asList
(
plate
));
facade
.
listRawImageDatasets
(
Arrays
.
asList
(
plate
));
if
(
imageDatasets
.
size
()
==
0
)
if
(
imageDatasets
.
size
()
==
0
)
...
@@ -77,8 +79,26 @@ public class LoadImagesScreeningClientApiTest
...
@@ -77,8 +79,26 @@ public class LoadImagesScreeningClientApiTest
System
.
err
.
println
(
"No image datasets connected to plate "
+
plate
);
System
.
err
.
println
(
"No image datasets connected to plate "
+
plate
);
System
.
exit
(
1
);
System
.
exit
(
1
);
}
}
// take the first image dataset
ImageDatasetReference
imageDataset
=
imageDatasets
.
get
(
0
);
printImagesMetadata
(
facade
,
imageDatasets
);
loadOneImage
(
facade
,
imageDatasets
.
get
(
0
));
facade
.
logout
();
}
private
static
void
printImagesMetadata
(
IScreeningOpenbisServiceFacade
facade
,
List
<
ImageDatasetReference
>
imageDatasets
)
{
List
<
ImageDatasetMetadata
>
imageMetadatas
=
facade
.
listImageMetadata
(
imageDatasets
);
for
(
ImageDatasetMetadata
imageMetadata
:
imageMetadatas
)
{
System
.
out
.
println
(
imageMetadata
);
}
}
private
static
void
loadOneImage
(
IScreeningOpenbisServiceFacade
facade
,
ImageDatasetReference
imageDataset
)
throws
IOException
{
// You could get to know more about the image dataset metadata with:
// You could get to know more about the image dataset metadata with:
// facade.listImageMetadata(imageDataset);
// facade.listImageMetadata(imageDataset);
// Here we will make some assumptions.
// Here we will make some assumptions.
...
@@ -92,8 +112,6 @@ public class LoadImagesScreeningClientApiTest
...
@@ -92,8 +112,6 @@ public class LoadImagesScreeningClientApiTest
WellPosition
well
=
new
WellPosition
(
row
,
column
);
WellPosition
well
=
new
WellPosition
(
row
,
column
);
PlateImageReference
imageRef
=
new
PlateImageReference
(
tile
,
channel
,
well
,
imageDataset
);
PlateImageReference
imageRef
=
new
PlateImageReference
(
tile
,
channel
,
well
,
imageDataset
);
loadImage
(
facade
,
imageRef
);
loadImage
(
facade
,
imageRef
);
facade
.
logout
();
}
}
private
static
File
createImageFile
(
PlateImageReference
imageRef
)
private
static
File
createImageFile
(
PlateImageReference
imageRef
)
...
...
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