Compare commits

...

17 Commits

Author SHA1 Message Date
Damien Goutte-Gattat ce283aba22 [maven-release-plugin] prepare for next development iteration 3 months ago
Damien Goutte-Gattat 6c35f22a01 [maven-release-plugin] prepare release incenp-imagej-plugins-0.9.6 3 months ago
Damien Goutte-Gattat b35fd4d14b Match header names in a case-insensitive manner by default. 4 months ago
Damien Goutte-Gattat 90f35b8bac Allow several names when looking for a specific cell. 4 months ago
Damien Goutte-Gattat 8a7339a2e8 [maven-release-plugin] prepare for next development iteration 4 months ago
Damien Goutte-Gattat b4a710ebbc [maven-release-plugin] prepare release incenp-imagej-plugins-0.9.5 4 months ago
Damien Goutte-Gattat 48fe51eb13 Update documentation. 4 months ago
Damien Goutte-Gattat f8c4267e18 Add the SciJava repository. 4 months ago
Damien Goutte-Gattat 1792a18875 Always call readCSV() if needed. 4 months ago
Damien Goutte-Gattat 7527b2e42f Bump dependencies. 4 months ago
Damien Goutte-Gattat ca7fa551bc Update documentation. 11 months ago
Damien Goutte-Gattat da77c7abc1 [maven-release-plugin] prepare for next development iteration 11 months ago
Damien Goutte-Gattat 3408d2b40a [maven-release-plugin] prepare release incenp-imagej-plugins-0.9.4 11 months ago
Damien Goutte-Gattat a6231d61e4 Prepare release to Maven Central. 11 months ago
Damien Goutte-Gattat c4ef652228 Add some more Maven plugins. 11 months ago
Damien Goutte-Gattat d1373bdfc0 Rename to incenp-imagej-plugins. 11 months ago
Damien Goutte-Gattat 3b2365967b [maven-release-plugin] prepare for next development iteration 11 months ago
  1. 23
      NEWS
  2. 28
      README.md
  3. 92
      pom.xml
  4. 76
      src/main/java/org/incenp/imagej/BatchReader.java
  5. 2
      src/main/java/org/incenp/imagej/BinaryOperator.java
  6. 2
      src/main/java/org/incenp/imagej/ChannelMasker.java
  7. 2
      src/main/java/org/incenp/imagej/Helper.java
  8. 2
      src/main/java/org/incenp/imagej/Masking.java
  9. 2
      src/main/java/org/incenp/imagej/NucleiSegmenter.java
  10. 2
      src/main/java/org/incenp/imagej/ThresholdingMethod.java
  11. 2
      src/main/java/org/incenp/imagej/plugins/About.java
  12. 2
      src/main/java/org/incenp/imagej/plugins/ExtendedPanel.java
  13. 2
      src/main/java/org/incenp/imagej/plugins/FrameIntervalInfo.java
  14. 6
      src/main/java/org/incenp/imagej/plugins/Info.java
  15. 2
      src/main/java/org/incenp/imagej/plugins/Launcher.java
  16. 2
      src/main/java/org/incenp/imagej/plugins/MergeDialog.java
  17. 2
      src/main/java/org/incenp/imagej/plugins/PanelDialog.java
  18. 2
      src/main/java/org/incenp/imagej/plugins/UnifiedMerge.java
  19. 22
      src/site/apt/index.apt
  20. 2
      src/site/site.xml

23
NEWS

@ -1,3 +1,26 @@
Changes in incenp-imagej-plugins-0.9.5
--------------------------------------
* Remove the need to explicitly call BatchReader.readCSV().
* Explicitly refer to the SciJava Maven repository in POM.
* Require more recent ImageJ (needed for MacOS development).
Changes in incenp-imagej-plugins-0.9.4
--------------------------------------
* Rename the artifact to incenp-imagej-plugins.
* Release to the Maven Central repository.
Changes in incenp-plugins-0.9.3
-------------------------------
* Allow application of multiple masks in a single operation.
* Accept alternative spelling for the Renyi_Entropy algorithm.
* Small bugfixes in methods from the Helper class.
Changes in incenp-plugins-0.9.2
-------------------------------

28
README.md

@ -1,7 +1,7 @@
Incenp-Plugins - Incenp.org ImageJ Plugins
==========================================
Incenp.org ImageJ Plugins
=========================
Incenp-Plugins is a set of plugins for the [ImageJ](https://imagej.net)
Incenp-ImageJ-Plugins is a set of plugins for the [ImageJ](https://imagej.net)
image analysis software.
Available Plugins
@ -24,22 +24,14 @@ Bundled with the plugins is a small library of helper classes for use in
other plugins or scripts. Notable classes include `BatchReader`, to
facilitate batch processing of images listed in a CSV input file, and
`ChannelMasker`, to facilitate the creation and manipulation of
binary masks. Refer to the package´s [Javadoc]
(https://incenp.org/dvlpt/imagej-plugins/apidocs/index.html) for more
details.
binary masks. Refer to the package´s
[Javadoc](https://incenp.org/dvlpt/imagej-plugins/apidocs/index.html)
for more details.
Installation
------------
To build the plugins with [Maven](https://maven.apache.org/), first
install the parent POM from my own repository by running
```
$ mvn dependency:get -DgroupId=org.incenp -DartifactId=incenp-base \
-Dversion=1.1.0 -Dpackaging=pom \
-DremoteRepositories=https://mvn.incenp.org/repo/releases
```
You can then build the plugins by running, from the source directory
Build the plugins with [Maven](https://maven.apache.org/) by running,
from the source directory
```
$ mvn package
@ -57,8 +49,8 @@ the plugins will be available in the `Plugins > Incenp.org` menu.
Copying
-------
Incenp-Plugins is distributed under the terms of the GNU General Public
License, version 3 or higher. The full license is included in the
Incenp-ImageJ-Plugins is distributed under the terms of the GNU General
Public License, version 3 or higher. The full license is included in the
[LICENSE file](LICENSE) of the source distribution.
Homepage and repository

92
pom.xml

@ -1,14 +1,9 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.incenp</groupId>
<artifactId>incenp-base</artifactId>
<version>1.1.0</version>
</parent>
<groupId>org.incenp.imagej</groupId>
<artifactId>incenp-plugins</artifactId>
<version>0.9.3</version>
<groupId>org.incenp</groupId>
<artifactId>incenp-imagej-plugins</artifactId>
<version>0.9.7-SNAPSHOT</version>
<name>Incenp.org ImageJ Plugins</name>
<description>Some plugins for ImageJ</description>
<url>https://incenp.org/dvlpt/imagej-plugins/</url>
@ -34,34 +29,48 @@
<connection>scm:git:https://git.incenp.org/damien/imagej-plugins.git</connection>
<developerConnection>scm:git:ssh://git@git.incenp.org/damien/imagej-plugins.git</developerConnection>
<url>https://git.incenp.org/damien/imagej-plugins</url>
<tag>incenp-plugins-0.9.3</tag>
<tag>HEAD</tag>
</scm>
<issueManagement>
<system>Gitea</system>
<url>https://git.incenp.org/damien/imagej-plugins/issues</url>
</issueManagement>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>scijava.public</id>
<url>https://maven.scijava.org/content/groups/public</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.imagej</groupId>
<artifactId>imagej</artifactId>
<version>2.0.0-rc-71</version>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>net.imagej</groupId>
<artifactId>imagej-legacy</artifactId>
<version>0.36.0</version>
<version>0.37.4</version>
</dependency>
<dependency>
<!-- For ImageJ2 plugin API -->
<groupId>org.scijava</groupId>
<artifactId>scijava-common</artifactId>
<version>2.77.0</version>
<version>2.85.0</version>
</dependency>
<dependency>
<!-- For util.opencsv -->
@ -88,7 +97,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>
<version>3.2.0</version>
<configuration>
<archive>
<manifest>
@ -114,12 +123,63 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.8.2</version>
<version>3.9.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
<version>3.1.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
@ -129,7 +189,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<version>3.2.0</version>
</plugin>
</plugins>
</reporting>

76
src/main/java/org/incenp/imagej/BatchReader.java

@ -1,5 +1,5 @@
/*
* Incenp.org Plugins
* Incenp.org ImageJ Plugins
* Copyright © 2019, 2020 Damien Goutte-Gattat
*
* This program is free software; you can redistribute it and/or modify
@ -64,6 +64,7 @@ public class BatchReader {
private String filename;
private String[] headers;
private boolean withHeaders;
private boolean caseSensitiveHeaders;
private ArrayList<String[]> rows;
private ImagePlus[] currentImages;
private Hashtable<String, Integer> headersIndex;
@ -78,6 +79,7 @@ public class BatchReader {
public BatchReader(String filename, boolean noHeaders) {
this.filename = filename;
this.withHeaders = !noHeaders;
caseSensitiveHeaders = false;
headers = null;
headersIndex = null;
cursor = subcursor = -1;
@ -114,6 +116,19 @@ public class BatchReader {
this(file.getAbsolutePath(), noHeaders);
}
/**
* Sets the case-sensitivity option. If set to true, the
* {@link #getCell(String)} method and its overloaded variants will match header
* names in a case-sensitive way. The default is false.
*
* @param caseSensitive true to match header names case-sensitively.
*/
public void setCaseSensitive(boolean caseSensitive) {
caseSensitiveHeaders = caseSensitive;
if ( headersIndex != null )
headersIndex = null;
}
/**
* Moves to the next available image. Once this method has been called and if it
* returned true, the image can be obtained by calling the {@link #getImage()}
@ -214,29 +229,62 @@ public class BatchReader {
}
/**
* Gets the contents of a specific cell within the current row.
* Gets the contents of a specific cell within the current row. The cell is
* searched for using several equally accepted names.
*
* @param name the column name, as indicated in the header row
* @param names an array of accepted column names
* @param fallback the default value to return if the cell is not found
* @return the contents of the specified cell
*/
public String getCell(String name) {
public String getCell(String[] names, String fallback) {
if ( headersIndex == null ) {
if ( (headersIndex = getHeadersIndex()) == null )
return null;
}
Integer indexObject = headersIndex.get(name);
if ( indexObject == null )
return "";
Integer index = null;
for ( int i = 0; i < names.length && index == null; i++ ) {
if ( !caseSensitiveHeaders )
index = headersIndex.get(names[i].toLowerCase());
else
index = headersIndex.get(names[i]);
}
return getCell(indexObject.intValue());
if ( index == null )
return fallback;
return getCell(index.intValue());
}
/**
* Gets the contents of a specific cell within the current row. The cell is
* searched for using several equally accepted names.
*
* @param names an array of accepted column names
* @return the contents of the specified cell
*/
public String getCell(String[] names) {
return getCell(names, "");
}
/**
* Gets the contents of a specific cell within the current row.
*
* @param name the column name, as indicated in the header row
* @return the contents of the specified cell
*/
public String getCell(String name) {
return getCell(new String[] { name }, "");
}
private Hashtable<String, Integer> getHeadersIndex() {
if ( headersIndex == null && headers != null ) {
headersIndex = new Hashtable<String, Integer>();
for ( int i = 0; i < headers.length; i++ ) {
headersIndex.put(headers[i], i);
if ( !caseSensitiveHeaders )
headersIndex.put(headers[i].toLowerCase(), i);
else
headersIndex.put(headers[i], i);
}
}
@ -281,7 +329,11 @@ public class BatchReader {
*
* @return the CSV file headers
*/
public String[] getHeaders() {
public String[] getHeaders() throws IOException {
if ( rows == null ) {
this.readCSV();
}
if ( headers == null ) {
headers = new String[1];
headers[0] = "Image";
@ -326,9 +378,7 @@ public class BatchReader {
/**
* Reads the entire CSV file. This method is automatically called by the
* {@link #next()} method if needed. However it is necessary to explicitly call
* it if the CSV headers need to be accessed (through the {@link #getHeaders()}
* method) prior to any call to next().
* {@link #next()} or {@link #getHeaders()} methods if needed.
*
* @throws IOException if any I/O error occurs while attempting to read the file
*/

2
src/main/java/org/incenp/imagej/BinaryOperator.java

@ -1,5 +1,5 @@
/*
* Incenp.org Plugins
* Incenp.org ImageJ Plugins
* Copyright © 2020 Damien Goutte-Gattat
*
* This program is free software; you can redistribute it and/or modify

2
src/main/java/org/incenp/imagej/ChannelMasker.java

@ -1,5 +1,5 @@
/*
* Incenp.org Plugins
* Incenp.org ImageJ Plugins
* Copyright © 2019, 2020, 2021 Damien Goutte-Gattat
*
* This program is free software; you can redistribute it and/or modify

2
src/main/java/org/incenp/imagej/Helper.java

@ -1,5 +1,5 @@
/*
* Incenp.org Plugins
* Incenp.org ImageJ Plugins
* Copyright © 2019, 2020, 2021 Damien Goutte-Gattat
*
* This program is free software; you can redistribute it and/or modify

2
src/main/java/org/incenp/imagej/Masking.java

@ -1,5 +1,5 @@
/*
* Incenp.org Plugins
* Incenp.org ImageJ Plugins
* Copyright © 2020 Damien Goutte-Gattat
*
* This program is free software; you can redistribute it and/or modify

2
src/main/java/org/incenp/imagej/NucleiSegmenter.java

@ -1,5 +1,5 @@
/*
* Incenp.org Plugins
* Incenp.org ImageJ Plugins
* Copyright © 2019 Damien Goutte-Gattat
*
* This program is free software; you can redistribute it and/or modify

2
src/main/java/org/incenp/imagej/ThresholdingMethod.java

@ -1,5 +1,5 @@
/*
* Incenp.org Plugins
* Incenp.org ImageJ Plugins
* Copyright © 2020 Damien Goutte-Gattat
*
* This program is free software; you can redistribute it and/or modify

2
src/main/java/org/incenp/imagej/plugins/About.java

@ -1,5 +1,5 @@
/*
* Incenp.org Plugins
* Incenp.org ImageJ Plugins
* Copyright © 2017, 2018, 2019 Damien Goutte-Gattat
*
* This program is free software; you can redistribute it and/or modify

2
src/main/java/org/incenp/imagej/plugins/ExtendedPanel.java

@ -1,5 +1,5 @@
/*
* Incenp.org Plugins
* Incenp.org ImageJ Plugins
* Copyright © 2017, 2019 Damien Goutte-Gattat
*
* This program is free software; you can redistribute it and/or modify

2
src/main/java/org/incenp/imagej/plugins/FrameIntervalInfo.java

@ -1,6 +1,6 @@
/*
* Incenp.org Plugins
* Copyright © 2017 Damien Goutte-Gattat
* Copyright © 2017 ImageJ Damien Goutte-Gattat
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

6
src/main/java/org/incenp/imagej/plugins/Info.java

@ -1,5 +1,5 @@
/*
* Incenp.org Plugins
* Incenp.org ImageJ Plugins
* Copyright © 2017, 2018, 2019 Damien Goutte-Gattat
*
* This program is free software; you can redistribute it and/or modify
@ -25,8 +25,8 @@ public class Info {
}
public static String getPackageInfo() {
return "Incenp.org Plugins " + Info.class.getPackage().getImplementationVersion()
+ "\nCopyright © 2017–2020 Damien Goutte-Gattat\n \n"
return "Incenp.org ImageJ Plugins " + Info.class.getPackage().getImplementationVersion()
+ "\nCopyright © 2017–2021 Damien Goutte-Gattat\n \n"
+ "These plugins are released under the GNU General Public License.";
}
}

2
src/main/java/org/incenp/imagej/plugins/Launcher.java

@ -1,5 +1,5 @@
/*
* Incenp.org Plugins
* Incenp.org ImageJ Plugins
* Copyright © 2019 Damien Goutte-Gattat
*
* This program is free software; you can redistribute it and/or modify

2
src/main/java/org/incenp/imagej/plugins/MergeDialog.java

@ -1,5 +1,5 @@
/*
* Incenp.org Plugins
* Incenp.org ImageJ Plugins
* Copyright © 2017, 2019 Damien Goutte-Gattat
*
* This program is free software; you can redistribute it and/or modify

2
src/main/java/org/incenp/imagej/plugins/PanelDialog.java

@ -1,5 +1,5 @@
/*
* Incenp.org Plugins
* Incenp.org ImageJ Plugins
* Copyright © 2017 Damien Goutte-Gattat
*
* This program is free software; you can redistribute it and/or modify

2
src/main/java/org/incenp/imagej/plugins/UnifiedMerge.java

@ -1,5 +1,5 @@
/*
* Incenp.org Plugins
* Incenp.org ImageJ Plugins
* Copyright © 2017, 2018, 2019 Damien Goutte-Gattat
*
* This program is free software; you can redistribute it and/or modify

22
src/site/apt/index.apt

@ -57,9 +57,9 @@ Setup
of the project.
Simply download the latest JAR file on that page (named
<incenp-plugins-X.X.Y.jar>, where <X.Y.X> is the latest version) and
save it anywhere under the <plugins> directory of your ImageJ
installation.
<incenp-imagej-plugins-X.X.Y.jar>, where <X.Y.X> is the latest
version) and save it anywhere under the <plugins> directory of your
ImageJ installation.
The plugins will be available upon the next restart of ImageJ under
the <Plugins\>Incenp.org> menu. You may also check the plugins were
@ -79,21 +79,13 @@ $ git clone https://git.incenp.org/damien/imagej-plugins.git
The project uses {{{https://maven.apache.org/}Maven}} as its build
system, so you need to have Maven installed with the <mvn> command
available from the shell. You will then need to install the parent
POM by running:
+-------------------------------------------------------------------
$ mvn dependency:get -DgroupId=org.incenp -DartifactId=incenp-base \
-Dversion=1.1.0 -Dpackaging=pom \
-DremoteRepositories=https://mvn.incenp.org/repo/releases
+-------------------------------------------------------------------
Then, simply run the following command from the source directory:
available from the shell. Then, simply run the following command from
the source directory:
+------------
$ mvn package
+------------
This will generate a JAR archive named <incenp-plugins-X.Y.Z.jar> in
the <target> directory. Install that file in your ImageJ’s <plugins>
This will generate a JAR archive named <incenp-imagej-plugins-X.Y.Z.jar>
in the <target> directory. Install that file in your ImageJ’s <plugins>
directory as described in the previous section.

2
src/site/site.xml

@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/DECORATION 1.8.0
http://maven.apache.org/xsd/decoration-1.8.0.xsd">
<body>
<menu name="Incenp Plugins">
<menu name="Incenp ImageJ Plugins">
<item name="About" href="index.html" />
<item name="Unified Merge Plugin" href="unified-merge.html" />
<item name="Extended Panel Plugin" href="extended-panel.html" />

Loading…
Cancel
Save