Skip to content

Commit

Permalink
Incorporated used of LocationAgnosticBioFormatsImg
Browse files Browse the repository at this point in the history
  • Loading branch information
djpbarry committed Feb 6, 2024
1 parent 7eeda83 commit 2c012c2
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 41 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<groupId>net.calm</groupId>
<artifactId>giani</artifactId>
<version>3.4.5</version>
<version>3.5.0</version>

<build>
<plugins>
Expand Down Expand Up @@ -155,7 +155,7 @@
<dependency>
<groupId>net.calm</groupId>
<artifactId>iaclasslibrary</artifactId>
<version>1.0.28</version>
<version>1.0.29</version>
</dependency>
<dependency>
<groupId>com.github.mcib3d</groupId>
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/net/calm/giani/exec/PipelineBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import mcib3d.geom.Objects3DPopulation;
import net.calm.giani.gianiparams.GianiDefaultParams;
import net.calm.iaclasslibrary.Extrema.MultiThreadedMaximaFinder;
import net.calm.iaclasslibrary.IO.BioFormats.BioFormatsImg;
import net.calm.iaclasslibrary.IO.BioFormats.LocationAgnosticBioFormatsImg;
import net.calm.iaclasslibrary.Process.Colocalise.MultiThreadedColocalise;
import net.calm.iaclasslibrary.Process.Filtering.MultiThreadedGaussianFilter;
import net.calm.iaclasslibrary.Process.Filtering.MultiThreadedTopHatFilter;
Expand Down Expand Up @@ -74,7 +74,7 @@ public static MultiThreadedMaximaFinder getDefaultMaximaFinder(Properties props)
propLabels[MultiThreadedMaximaFinder.THRESH_DETECT] = GianiDefaultParams.NUC_MAXIMA_DETECT_THRESHOLD;
propLabels[MultiThreadedMaximaFinder.THRESH_METHOD] = GianiDefaultParams.NUC_MAXIMA_SEG_THRESH_METHOD;
MultiThreadedMaximaFinder process = new MultiThreadedMaximaFinder(null);
process.setup(new BioFormatsImg(), props, propLabels);
process.setup(new LocationAgnosticBioFormatsImg(null), props, propLabels);
return process;
}

Expand All @@ -93,7 +93,7 @@ public static MultiThreadedTopHatFilter getDefaultNucTopHatFilteringProcess(Prop
propLabels[MultiThreadedTopHatFilter.RESIZE_FACTOR_LABEL] = GianiDefaultParams.NUC_TOP_HAT_DOWNSIZE_FACTOR_LABEL;
propLabels[MultiThreadedTopHatFilter.ENABLE_FILTER_LABEL] = GianiDefaultParams.ENABLE_TOP_HAT_FILTER;
MultiThreadedTopHatFilter process = new MultiThreadedTopHatFilter(inputs);
process.setup(new BioFormatsImg(), props, propLabels);
process.setup(new LocationAgnosticBioFormatsImg(null), props, propLabels);
return process;
}

Expand All @@ -109,7 +109,7 @@ public static MultiThreadedGaussianFilter getDefaultNucFilteringProcess(Properti
propLabels[MultiThreadedGaussianFilter.SERIES_LABEL] = GianiDefaultParams.SERIES_SELECT_LABEL;
propLabels[MultiThreadedGaussianFilter.FILT_RAD_LABEL] = GianiDefaultParams.NUC_FILT_RAD_LABEL;
MultiThreadedGaussianFilter process = new MultiThreadedGaussianFilter(null);
process.setup(new BioFormatsImg(), props, propLabels);
process.setup(new LocationAgnosticBioFormatsImg(null), props, propLabels);
return process;
}

Expand All @@ -135,7 +135,7 @@ public static MultiThreadedWatershed getDefaultNucSegmenter(Properties props, Mu
false,
cells,
MultiThreadedWatershed.NUCLEI);
process.setup(new BioFormatsImg(), props, propLabels);
process.setup(new LocationAgnosticBioFormatsImg(null), props, propLabels);
return process;
}

Expand All @@ -151,7 +151,7 @@ public static MultiThreadedGaussianFilter getDefaultCellFilteringProcess(Propert
propLabels[MultiThreadedGaussianFilter.CHANNEL_LABEL] = GianiDefaultParams.CELL_SEG_CHAN_SELECT_LABEL;
propLabels[MultiThreadedGaussianFilter.SERIES_LABEL] = GianiDefaultParams.SERIES_SELECT_LABEL;
propLabels[MultiThreadedGaussianFilter.FILT_RAD_LABEL] = GianiDefaultParams.CELL_FILT_RAD_LABEL;
process.setup(new BioFormatsImg(), props, propLabels);
process.setup(new LocationAgnosticBioFormatsImg(null), props, propLabels);
return process;
}

Expand Down Expand Up @@ -179,7 +179,7 @@ public static MultiThreadedWatershed getDefaultCellSegmenter(Properties props, M
cells,
MultiThreadedWatershed.CELLS
);
process.setup(new BioFormatsImg(), props, propLabels);
process.setup(new LocationAgnosticBioFormatsImg(null), props, propLabels);
return process;
}

Expand All @@ -201,7 +201,7 @@ public static MultiThreadedROIConstructor getDefaultMeasure(Properties props, Mu
inputs,
cells
);
process.setup(new BioFormatsImg(), props, propLabels);
process.setup(new LocationAgnosticBioFormatsImg(null), props, propLabels);
return process;
}

Expand Down Expand Up @@ -285,7 +285,7 @@ public static MultiThreadedMaximaFinder getDefaultFociMaximaFinder(Properties pr
propLabels[MultiThreadedMaximaFinder.THRESH_METHOD] = String.format("%s%d", GianiDefaultParams.BLOB_CHAN_SEG_THRESH_METHOD, i);
propLabels[MultiThreadedMaximaFinder.THRESH_DETECT] = String.format("%s%d", GianiDefaultParams.BLOB_CHAN_DETECT_THRESHOLD, i);
MultiThreadedMaximaFinder process = new MultiThreadedMaximaFinder(null);
process.setup(new BioFormatsImg(), props, propLabels);
process.setup(new LocationAgnosticBioFormatsImg(null), props, propLabels);
return process;
}

Expand All @@ -295,7 +295,7 @@ public static MultiThreadedColocalise getDefaultColocalisationProcess(Properties
localisationPropLabels[MultiThreadedColocalise.CHANNELS_LABEL] = GianiDefaultParams.CHAN_FOR_MEASURE;
localisationPropLabels[MultiThreadedColocalise.OUTPUT_LABEL] = GianiDefaultParams.OUTPUT_DIR_LABEL;
MultiThreadedColocalise process = new MultiThreadedColocalise(inputs, cells);
process.setup(new BioFormatsImg(), props, localisationPropLabels);
process.setup(new LocationAgnosticBioFormatsImg(null), props, localisationPropLabels);
return process;
}
}
22 changes: 12 additions & 10 deletions src/main/java/net/calm/giani/exec/PipelineExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
import ij.plugin.filter.Analyzer;
import ij.plugin.frame.RoiManager;
import loci.common.DebugTools;
import loci.formats.FormatException;
import net.calm.giani.gianiparams.GianiDefaultParams;
import net.calm.iaclasslibrary.IO.BioFormats.BioFormatsFileLister;
import net.calm.iaclasslibrary.IO.BioFormats.BioFormatsImg;
import net.calm.iaclasslibrary.IO.BioFormats.LocationAgnosticBioFormatsImg;
import net.calm.iaclasslibrary.IO.DataWriter;
import net.calm.iaclasslibrary.IO.PropertyWriter;
import net.calm.iaclasslibrary.Process.MultiThreadedProcess;
Expand Down Expand Up @@ -55,8 +54,9 @@ public class PipelineExecutor extends Thread {

/**
* Construct an executor with the specified pipeline and properties
*
* @param pipeline the {@link ProcessPipeline} to be executed
* @param props the parameter-value pairs for every process in the pipeline
* @param props the parameter-value pairs for every process in the pipeline
*/
public PipelineExecutor(ProcessPipeline pipeline, Properties props) {
this.pipeline = pipeline;
Expand Down Expand Up @@ -94,12 +94,14 @@ public void run() {
ExecutorService exec = Executors.newSingleThreadExecutor();
while (files.size() > 0) {
String file = files.get(0);
BioFormatsImg img = new BioFormatsImg();
try {
img.setId(String.format("%s%s%s", input, File.separator, file));
} catch (IOException | FormatException e) {
GenUtils.logError(e, String.format("Failed to initialise %s", file));
}
String bioFormatsOptions = String.format("location=[Local machine] open=[%s%s%s] windowless=true view=Hyperstack",
input, File.separator, file);
LocationAgnosticBioFormatsImg img = new LocationAgnosticBioFormatsImg(bioFormatsOptions);
// try {
// img.setId(String.format("%s%s%s", input, File.separator, file));
// } catch (IOException | FormatException e) {
// GenUtils.logError(e, String.format("Failed to initialise %s", file));
// }
props.put(img.reformatFileName(), file);
IJ.log(String.format("Analysing file %s", FilenameUtils.getName(file)));
int nSeries = img.getSeriesCount();
Expand Down Expand Up @@ -152,7 +154,7 @@ public void run() {
IJ.log(String.format("Done %s", TimeAndDate.getCurrentTimeAndDate()));
}

private void updateFileList(BioFormatsImg img, ArrayList<String> files) {
private void updateFileList(LocationAgnosticBioFormatsImg img, ArrayList<String> files) {
String[] relatedFiles = img.getFileList();
for (String rf : relatedFiles) {
for (String f : files) {
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/net/calm/giani/ui/FilteringPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.calm.giani.gianiparams.GIANIParamInfos;
import net.calm.giani.gianiparams.GianiDefaultParams;
import net.calm.iaclasslibrary.IO.BioFormats.BioFormatsImg;
import net.calm.iaclasslibrary.IO.BioFormats.LocationAgnosticBioFormatsImg;
import net.calm.iaclasslibrary.Process.Filtering.MultiThreadedGaussianFilter;
import net.calm.iaclasslibrary.UIClasses.LayerPanel;
import net.calm.iaclasslibrary.UIClasses.Updateable;
Expand Down Expand Up @@ -44,7 +45,7 @@ public FilteringPanel() {
* @param process the process that this panel is seeking user-specified parameters for
* @param propLabels the labels associated with the parameters that this panel will display
*/
public FilteringPanel(Properties props, BioFormatsImg img, MultiThreadedGaussianFilter process, String[] propLabels) {
public FilteringPanel(Properties props, LocationAgnosticBioFormatsImg img, MultiThreadedGaussianFilter process, String[] propLabels) {
this(props, img, process, propLabels, null, null);
}

Expand All @@ -58,7 +59,7 @@ public FilteringPanel(Properties props, BioFormatsImg img, MultiThreadedGaussian
* @param helpURI link to an online help page describing how to use this panel
* @param title description of what this panel does
*/
public FilteringPanel(Properties props, BioFormatsImg img, MultiThreadedGaussianFilter process, String[] propLabels, URI helpURI, String title) {
public FilteringPanel(Properties props, LocationAgnosticBioFormatsImg img, MultiThreadedGaussianFilter process, String[] propLabels, URI helpURI, String title) {
super(props, img, process, propLabels, helpURI);
this.title = title;
this.info = new GIANIParamInfos();
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/net/calm/giani/ui/GIANIUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import net.calm.giani.gianiparams.GIANIParamInfos;
import net.calm.giani.gianiparams.GianiDefaultParams;
import net.calm.iaclasslibrary.Extrema.MultiThreadedMaximaFinder;
import net.calm.iaclasslibrary.IO.BioFormats.BioFormatsImg;
import net.calm.iaclasslibrary.IO.BioFormats.LocationAgnosticBioFormatsImg;
import net.calm.iaclasslibrary.IO.PropertyWriter;
import net.calm.iaclasslibrary.Process.Colocalise.MultiThreadedColocalise;
import net.calm.iaclasslibrary.Process.Filtering.MultiThreadedGaussianFilter;
Expand Down Expand Up @@ -38,7 +38,7 @@
*/
public class GIANIUI extends javax.swing.JFrame implements GUIMethods {

private final BioFormatsImg img;
private final LocationAgnosticBioFormatsImg img;
private static Properties props;
private final LinkedList<LayerPanel> componentList = new LinkedList();
private int layerIndex = 0;
Expand All @@ -61,7 +61,7 @@ public class GIANIUI extends javax.swing.JFrame implements GUIMethods {
*/
public GIANIUI() {
DebugTools.setRootLevel("WARN");
img = new BioFormatsImg();
img = new LocationAgnosticBioFormatsImg(null);
pipeline = new ProcessPipeline();
cells = new Objects3DPopulation();
this.info = new GIANIParamInfos();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/calm/giani/ui/LocalisationPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
package net.calm.giani.ui;

import net.calm.iaclasslibrary.IO.BioFormats.BioFormatsImg;
import net.calm.iaclasslibrary.IO.BioFormats.LocationAgnosticBioFormatsImg;
import net.calm.iaclasslibrary.Process.Colocalise.MultiThreadedColocalise;
import net.calm.iaclasslibrary.UIClasses.LayerPanel;

Expand Down Expand Up @@ -45,7 +45,7 @@ public LocalisationPanel() {
* @param process the process that this panel is seeking user-specified parameters for
* @param propLabels the labels associated with the parameters that this panel will display
*/
public LocalisationPanel(Properties props, BioFormatsImg img, MultiThreadedColocalise process, String[] propLabels) {
public LocalisationPanel(Properties props, LocationAgnosticBioFormatsImg img, MultiThreadedColocalise process, String[] propLabels) {
super(props, img, process, propLabels, null);
initComponents();
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/calm/giani/ui/MaximaFinderPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import net.calm.giani.gianiparams.GIANIParamInfos;
import net.calm.giani.gianiparams.GianiDefaultParams;
import net.calm.iaclasslibrary.Extrema.MultiThreadedMaximaFinder;
import net.calm.iaclasslibrary.IO.BioFormats.BioFormatsImg;
import net.calm.iaclasslibrary.IO.BioFormats.LocationAgnosticBioFormatsImg;
import net.calm.iaclasslibrary.UIClasses.LayerPanel;
import net.calm.iaclasslibrary.UIClasses.Updateable;
import net.calm.iaclasslibrary.UtilClasses.GenUtils;
Expand Down Expand Up @@ -80,7 +80,7 @@ public MaximaFinderPanel() {
* panel
* @param title description of what this panel does
*/
public MaximaFinderPanel(Properties props, BioFormatsImg img, MultiThreadedMaximaFinder process, String[] propLabels, boolean allowChannelSelect, int defaultChannel, URI helpURI, String title) {
public MaximaFinderPanel(Properties props, LocationAgnosticBioFormatsImg img, MultiThreadedMaximaFinder process, String[] propLabels, boolean allowChannelSelect, int defaultChannel, URI helpURI, String title) {
super(props, img, process, propLabels, helpURI);
this.allowChannelSelect = allowChannelSelect;
this.defaultChannel = defaultChannel;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/calm/giani/ui/MeasurementPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import ij.plugin.filter.Analyzer;
import net.calm.giani.gianiparams.GIANIParamInfos;
import net.calm.giani.gianiparams.GianiDefaultParams;
import net.calm.iaclasslibrary.IO.BioFormats.BioFormatsImg;
import net.calm.iaclasslibrary.IO.BioFormats.LocationAgnosticBioFormatsImg;
import net.calm.iaclasslibrary.Process.ROI.MultiThreadedROIConstructor;
import net.calm.iaclasslibrary.UIClasses.LayerPanel;
import net.calm.iaclasslibrary.UIClasses.Updateable;
Expand Down Expand Up @@ -53,7 +53,7 @@ public MeasurementPanel() {
* @param propLabels the labels associated with the parameters that this panel will display
* @param helpURI link to an online help page describing how to use this panel
*/
public MeasurementPanel(Properties props, BioFormatsImg img, MultiThreadedROIConstructor process, String[] propLabels, URI helpURI) {
public MeasurementPanel(Properties props, LocationAgnosticBioFormatsImg img, MultiThreadedROIConstructor process, String[] propLabels, URI helpURI) {
super(props, img, process, propLabels, helpURI);
this.info = new GIANIParamInfos();
initComponents();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/calm/giani/ui/SegmentationPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import ij.process.AutoThresholder;
import net.calm.giani.gianiparams.GIANIParamInfos;
import net.calm.giani.gianiparams.GianiDefaultParams;
import net.calm.iaclasslibrary.IO.BioFormats.BioFormatsImg;
import net.calm.iaclasslibrary.IO.BioFormats.LocationAgnosticBioFormatsImg;
import net.calm.iaclasslibrary.Process.Segmentation.MultiThreadedWatershed;
import net.calm.iaclasslibrary.UIClasses.LayerPanel;
import net.calm.iaclasslibrary.UIClasses.Updateable;
Expand Down Expand Up @@ -49,7 +49,7 @@ public SegmentationPanel() {
* @param helpURI link to an online help page describing how to use this panel
* @param title description of what this panel does
*/
public SegmentationPanel(Properties props, BioFormatsImg img, MultiThreadedWatershed process, String[] propLabels, URI helpURI, String title) {
public SegmentationPanel(Properties props, LocationAgnosticBioFormatsImg img, MultiThreadedWatershed process, String[] propLabels, URI helpURI, String title) {
super(props, img, process, propLabels, helpURI);
this.title = title;
this.info = new GIANIParamInfos();
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/net/calm/giani/ui/SelectInputPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import net.calm.giani.gianiparams.GIANIParamInfos;
import net.calm.giani.gianiparams.GianiDefaultParams;
import net.calm.iaclasslibrary.IO.BioFormats.BioFormatsFileLister;
import net.calm.iaclasslibrary.IO.BioFormats.BioFormatsImg;
import net.calm.iaclasslibrary.IO.BioFormats.LocationAgnosticBioFormatsImg;
import net.calm.iaclasslibrary.UIClasses.LayerPanel;
import net.calm.iaclasslibrary.UtilClasses.GenUtils;
import net.calm.iaclasslibrary.UtilClasses.Utilities;
Expand Down Expand Up @@ -60,7 +60,7 @@ public SelectInputPanel() {
* @param img the image that the process associated with this panel will run on
* @param propLabels the labels associated with the parameters that this panel will display
*/
public SelectInputPanel(Properties props, BioFormatsImg img, String[] propLabels) {
public SelectInputPanel(Properties props, LocationAgnosticBioFormatsImg img, String[] propLabels) {
this(props, img, propLabels, null);
}

Expand All @@ -72,7 +72,7 @@ public SelectInputPanel(Properties props, BioFormatsImg img, String[] propLabels
* @param propLabels the labels associated with the parameters that this panel will display
* @param helpURI link to an online help page describing how to use this panel
*/
public SelectInputPanel(Properties props, BioFormatsImg img, String[] propLabels, URI helpURI) {
public SelectInputPanel(Properties props, LocationAgnosticBioFormatsImg img, String[] propLabels, URI helpURI) {
super(props, img, null, propLabels, helpURI);
initComponents();
this.info = new GIANIParamInfos();
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/net/calm/giani/ui/TopHatFilterPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import net.calm.giani.gianiparams.GIANIParamInfos;
import net.calm.giani.gianiparams.GianiDefaultParams;
import net.calm.iaclasslibrary.IO.BioFormats.BioFormatsImg;
import net.calm.iaclasslibrary.IO.BioFormats.LocationAgnosticBioFormatsImg;
import net.calm.iaclasslibrary.Process.Filtering.MultiThreadedTopHatFilter;
import net.calm.iaclasslibrary.UIClasses.LayerPanel;
import net.calm.iaclasslibrary.UIClasses.Updateable;
Expand Down Expand Up @@ -48,7 +48,7 @@ public TopHatFilterPanel() {
* @param propLabels the labels associated with the parameters that this
* panel will display
*/
public TopHatFilterPanel(Properties props, BioFormatsImg img, MultiThreadedTopHatFilter process, String[] propLabels) {
public TopHatFilterPanel(Properties props, LocationAgnosticBioFormatsImg img, MultiThreadedTopHatFilter process, String[] propLabels) {
this(props, img, process, propLabels, null, null);
}

Expand All @@ -68,7 +68,7 @@ public TopHatFilterPanel(Properties props, BioFormatsImg img, MultiThreadedTopHa
* panel
* @param title description of what this panel does
*/
public TopHatFilterPanel(Properties props, BioFormatsImg img, MultiThreadedTopHatFilter process, String[] propLabels, URI helpURI, String title) {
public TopHatFilterPanel(Properties props, LocationAgnosticBioFormatsImg img, MultiThreadedTopHatFilter process, String[] propLabels, URI helpURI, String title) {
super(props, img, process, propLabels, helpURI);
this.title = title;
this.info = new GIANIParamInfos();
Expand Down

0 comments on commit 2c012c2

Please sign in to comment.