Skip to content

Commit

Permalink
Merged modifications (#5)
Browse files Browse the repository at this point in the history
* Added command to only list objects belonging to a given user

* Split Overlay and RoiManager ROIs processing.
Now only refresh saved ROIs after import.

* Added unlink function

* Added test results logging

* Added new tests

* Added codecov to CI

* Changed log format and added new test

* Added option to load ROIs to Overlay instead of the ROI Manager

* Added test for downloadImage

* Added tests

* Added test for saveTableAsTXT

* Modified saveTableAsTXT to only store DataObject IDs

* Changed saveTableAsTXT to saveTableAsFile with delimiter of choice (default: ',')

* Bumped version number
  • Loading branch information
ppouchin authored Dec 10, 2021
1 parent c61b9b3 commit 6178dbb
Show file tree
Hide file tree
Showing 9 changed files with 682 additions and 95 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ jobs:
DOCKER_ARGS: -v ${{ env.HOME }}/.m2:/root/.m2 -v ${{ github.workspace }}/target:/src/target -t
- name: Set folders ownership back to current user
run: sudo chown -R $(id -u):$(id -g) $GITHUB_WORKSPACE && sudo chown -R $(id -u):$(id -g) $HOME
- name: Upload to codecov after successful tests
if: ${{ success() }}
run: bash <(curl -s https://codecov.io/bash)
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
Expand Down
32 changes: 23 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ A plugin for ImageJ to provide macro extensions to access OMERO.

## How to install

1. Install the [OMERO.insight plugin for Fiji](https://omero-guides.readthedocs.io/en/latest/fiji/docs/installation.html) (if you haven't already).
1. Install
the [OMERO.insight plugin for Fiji](https://omero-guides.readthedocs.io/en/latest/fiji/docs/installation.html) (if
you haven't already).
2. Download the JAR file for this [library](https://github.com/GReD-Clermont/simple-omero-client/releases/latest/).
3. Download the JAR file ([for this plugin](https://github.com/GReD-Clermont/omero_macro-extensions/releases/latest/)).
4. Place these JAR files in your plugins folder.
Expand All @@ -33,6 +35,12 @@ Then, switching group can be performed through:
Ext.switchGroup(groupId);
```

You can also choose to only list objects for a given user (or all if username is empty or equal to "all"):

```
Ext.listForUser(username);
```

When done, you can disconnect using:

```
Expand Down Expand Up @@ -165,14 +173,20 @@ Tags can be created with *Ext.createTag*:
tagId = Ext.createTag(name, description);
```

### Linking objects
### Linking/unlinking objects

Objects can be linked with *Ext.link*, e.g.:

```
Ext.link("dataset", datasetId, "tag", tagId);
```

They can also be unlinked with *Ext.unlink*, e.g.:

```
Ext.unlink("dataset", datasetId, "tag", tagId);
```

### Deleting objects

Objects can be deleted with *Ext.delete*:
Expand All @@ -189,13 +203,13 @@ Pixel intensities can be retrieved from images:
imageplusID = Ext.getImage(imageIds[0]);
```

ROIs from OMERO can also be added to the ROI manager (and the current image). ROIs composed of multiple shapes (eg
3D/4D) will share the same values in the "ROI" and "ROI_ID" properties in ImageJ. These can be optionnally changed with
the "property" parameter: local indices will be in "property" while OMERO IDs will be in "property + _ID". This is
achieved through:
ROIs from OMERO can also be added to the ROI manager or to the Overlay of the current image (boolean toOverlay). ROIs
composed of multiple shapes (eg 3D/4D) will share the same values in the "ROI" and "ROI_ID" properties in ImageJ. These
can be optionally changed with the "property" parameter: local indices will be in "property" while OMERO IDs will be
in "property + _ID". This is achieved through:

```
nIJROIs = Ext.getROIs(imageIds[0], property);
nIJROIs = Ext.getROIs(imageIds[0], toOverlay, property);
```

Conversely, ImageJ ROIs can also be saved to OMERO (the property is used to group ImageJ shapes into a single 3D/4D ROI
Expand Down Expand Up @@ -245,10 +259,10 @@ The table can then be saved to a project/dataset/image through *Ext.saveTable*:
Ext.saveTable(tableName, 'dataset', datasetId);
```

It can then be saved to a tab-separated text file through *Ext.saveTableAsTXT*:
It can then be saved to a delimited text file through *Ext.saveTableAsFile* (default separator is ','):

```
Ext.saveTableAsTXT(tableName, pathToTXT);
Ext.saveTableAsFile(tableName, pathToFile, delimiter);
```

### Work as another user (sudo)
Expand Down
6 changes: 6 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
coverage:
range: "60...90"
status:
patch:
default:
only_pulls: true
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>fr.igred</groupId>
<artifactId>omero_macro-extensions</artifactId>
<version>1.0.1</version>
<version>1.1.0</version>

<name>ImageJ OMERO macro extensions</name>
<description>Plugin providing macro extensions for OMERO.</description>
Expand Down Expand Up @@ -110,13 +110,13 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.7.1</version>
<version>5.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.7.1</version>
<version>5.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Loading

0 comments on commit 6178dbb

Please sign in to comment.