Skip to content

Commit

Permalink
Crop from coordinates (#3)
Browse files Browse the repository at this point in the history
* Updated simple-omero-client to 5.14.1
* Changed String password to char (simple-omero-client update)
* Added "From OMERO" option to CropFromCoordinate, Changed buttons style.
* Backend for "OMERO option" in CropFromCoordinates.
* Changed the way to save ROIs, Changed Label of "Boxes regrouping".
* Fixed CropFromCoordinatesDialog name and serialVersionUID
* Save autocrop ROIs even if ROIs are already present

---------

Co-authored-by: SafarbatiSami <[email protected]>
  • Loading branch information
ppouchin and SafarbatiSami authored Jul 19, 2023
1 parent bc77636 commit 6ba29a4
Show file tree
Hide file tree
Showing 10 changed files with 659 additions and 231 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<dependency>
<groupId>fr.igred</groupId>
<artifactId>simple-omero-client</artifactId>
<version>5.7.0</version>
<version>5.14.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/gred/nucleus/autocrop/AutoCrop.java
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ public void cropKernelsOMERO(ImageWrapper image, Long[] outputsDat, Client clien
info.append(getSpecificImageInfo()).append(HEADERS);
for (int c = 0; c < this.channelNumbers; c++) {
DatasetWrapper dataset = client.getDataset(outputsDat[c]);
List<ROIWrapper> rois = new ArrayList<>(this.boxes.size());
for (Map.Entry<Double, Box> entry : new TreeMap<>(this.boxes).entrySet()) {
int i = entry.getKey().intValue();
LOGGER.info("Processing box number: {} (OMERO)", i);
Expand Down Expand Up @@ -481,7 +482,8 @@ public void cropKernelsOMERO(ImageWrapper image, Long[] outputsDat, Client clien
shapes.add(rectangle);
}
ROIWrapper roi = new ROIWrapper(shapes);
image.saveROI(client, roi);
roi.setName(String.valueOf(i));
rois.add(roi);
ImagePlus croppedImage = image.toImagePlus(client, xBound, yBound, cBound, zBound, null);
Calibration cal = this.rawImg.getCalibration();
croppedImage.setCalibration(cal);
Expand Down Expand Up @@ -527,6 +529,7 @@ public void cropKernelsOMERO(ImageWrapper image, Long[] outputsDat, Client clien
zMax);
}
}
image.saveROIs(client, rois);
}
this.infoImageAnalysis += info.toString();
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/gred/nucleus/cli/CLIRunActionOMERO.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class CLIRunActionOMERO {
Client client = new Client();

/** OMERO password connection */
String mdp;
char[] mdp;

/** OMERO type of data to analyse : image data dataset tag */
String dataType;
Expand Down Expand Up @@ -126,11 +126,11 @@ public static void autoCropOMERO(String inputDirectory,

public void getOMEROPassword() {
if (this.cmd.hasOption("password")) {
this.mdp = this.cmd.getOptionValue("password");
this.mdp = this.cmd.getOptionValue("password").toCharArray();
} else {
System.console().writer().println("Enter password: ");
Console con = System.console();
this.mdp = String.valueOf(con.readPassword());
this.mdp = con.readPassword();
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/gred/nucleus/dialogs/AutocropDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ public AutocropDialog(IDialogListener dialogListener) {
jTextFieldHostname.setText("omero.gred-clermont.fr");
jTextFieldPort.setText("4064");

jTextFieldUsername.setText("demo");
jPasswordField.setText("Isim@42");
jTextFieldUsername.setText("");
jPasswordField.setText("");
jTextFieldGroup.setText("553");

jComboBoxDataType.setSelectedIndex(3);
Expand Down Expand Up @@ -311,8 +311,8 @@ public String getUsername() {
}


public String getPassword() {
return String.valueOf(jPasswordField.getPassword());
public char[] getPassword() {
return jPasswordField.getPassword();
}


Expand Down
204 changes: 0 additions & 204 deletions src/main/java/gred/nucleus/dialogs/CropFromCoodinateDialog.java

This file was deleted.

Loading

0 comments on commit 6ba29a4

Please sign in to comment.