Phriction Projects Wikis Bioimaging And Optics Platform Image Processing QuPath BIOP Tools QuPath Extension History Version 1 vs 10
Version 1 vs 10
Version 1 vs 10
Content Changes
Content Changes
= Description =
This extension, with source located at rQPEBIOP is the current 'fourre-tout' for all the new features we are currently implementing for QuPath to make our users' lives simpler.
== Requirements ==
Because some features (Like saving display settigns) were not programmer-accessible (`private`), we had to modify QuPath's code. Which is why most features are only available if you are running *QuPath v0.1.4**.
== Contents ==
=== GUI Utilities ===
==== applyDisplaySettingsToProject() ====
Will apply the current display settings (Visible Channels, Histogram Min-Max, Channel Colors) to all images in the project with **the same image type and number of channels**
lang=java
import ch.epfl.biop.qupath.utils.GUIUtils
GUIUtils.applyDisplaySettingsToProject()
==== getChannelMinMax(int channel) ====
Returns a list of Integers with the min and max display values for the current channel (one-based)
lang=java
import ch.epfl.biop.qupath.utils.GUIUtils
def channel = 3
def min_max = GUIUtils.getChannelMinMax( channel )
println( sprintf( "Max is %d for channel %d", min_max[1], channel ) )
==== getChannelMinMax(java.lang.String channel) ====
Returns a list with the minimum and maximum display values for the given channel defined by its name
lang=java
import ch.epfl.biop.qupath.utils.GUIUtils
// Image is RGB H&E
def channel = "Optical density sum"
def min_max = GUIUtils.getChannelMinMax( channel )
println( sprintf( "Max is %d for channel %s", min_max[1], channel ) )
==== getImagePlus(qupath.lib.objects.PathObject pathObject, int downsample, boolean sendPathObjectAsRoi, boolean sendChildObjectsInOverlay)
Returns an ImagePlus object with or without a ROI and with or without an overlay (if there are child objects)
lang=java
import ch.epfl.biop.qupath.utils.GUIUtils
def object = getSelectedObject()
def downsample = 4
def sendObject = false
def sendChildObjects = false
def imp = GUIUtils.getImagePlus( object, downsample, sendObject, sendChildObjects )
imp.show()
==== loadDisplaySettings(java.io.File fileToLoad) ====
Loads the display settings (Brightness, contrast, LUT, Min-Max) from a json serialized file created with **saveDisplaySettings()**
```lang=java
import ch.epfl.biop.qupath.utils.GUIUtils
def settingsDir = buildFilePath( PROJECT_BASE_DIR, "settings" )
mkdirs(settingsDir)
def loadFile = new File( settingsDir, 'CustomSettings.json')
GUIUtils.loadDisplaySettings( loadFile )
```
==== saveDisplaySettings(java.io.File fileToSave) ====
Saves the current display settings (Brightness, contrast, LUT, Min-Max) to a json serialized file that can be used with with **loadDisplaySettings()**
```lang=java
import ch.epfl.biop.qupath.utils.GUIUtils
def settingsDir = buildFilePath( PROJECT_BASE_DIR, "settings" )
mkdirs(settingsDir)
def saveFile = new File( settingsDir, 'CustomSettings.json')
GUIUtils.loadDisplaySettings( saveFile )
```
==== setActiveChannels(java.util.ArrayList<java.lang.Integer> theChannels) ====
Sets the channels in the list to active and deactivates the ones not in it
```lang=java
import ch.epfl.biop.qupath.utils.GUIUtils
def activeChannels = [1,3]
GUIUtils.setActiveChannels( activeChannels )
```
IMPORTANT: This command does not update the "Brightness and Contrast" window, which no longer reflects the current state until you change something
static void setActiveChannelsByName(java.util.ArrayList<java.lang.String> channelNames)
Sets the channels in the list to active and deactivated the ones not in it
static void setChannelColor(int channel, javafx.scene.paint.Color color)
Sets the color of the selected channel
static void setChannelColor(java.lang.String channelName, javafx.scene.paint.Color color)
Sets the color of the selected channel
static void setChannelMinMax(int channelID, int min, int max)
Sets the minimum and maximum display range for a channel, defined by its index (1 based)
static void setChannelMinMax(java.lang.String channelName, int min, int max)
Sets the minimum and maximum display range for a channel, defined by its name
static void setChannelsMinMax(java.util.List<java.lang.Integer> channelIndexes, java.util.List<java.lang.Integer> minValues, java.util.List<java.lang.Integer> maxValues)
= Description =
This extension, with source located at rQPEBIOP is the current 'fourre-tout' for all the new features we are currently implementing for QuPath to make our users' lives simpler.
== Requirements ==
Because some features (Like saving display settigns) were not programmer-accessible (`private`), we had to modify QuPath's code. Which is why most features are only available if you are running *QuPath v0.1.4**.
== Contents ==
=== GUI Utilities ===
==== applyDisplaySettingsToProject() ====
Will apply the current display settings (Visible Channels, Histogram Min-Max, Channel Colors) to all images in the project with **the same image type and number of channels**
lang=java
import ch.epfl.biop.qupath.utils.GUIUtils
GUIUtils.applyDisplaySettingsToProject()
==== getChannelMinMax(int channel) ====
Returns a list of Integers with the min and max display values for the current channel (one-based)
lang=java
import ch.epfl.biop.qupath.utils.GUIUtils
def channel = 3
def min_max = GUIUtils.getChannelMinMax( channel )
println( sprintf( "Max is %d for channel %d", min_max[1], channel ) )
==== getChannelMinMax(java.lang.String channel) ====
Returns a list with the minimum and maximum display values for the given channel defined by its name
lang=java
import ch.epfl.biop.qupath.utils.GUIUtils
// Image is RGB H&E
def channel = "Optical density sum"
def min_max = GUIUtils.getChannelMinMax( channel )
println( sprintf( "Max is %d for channel %s", min_max[1], channel ) )
==== getImagePlus(qupath.lib.objects.PathObject pathObject, int downsample, boolean sendPathObjectAsRoi, boolean sendChildObjectsInOverlay)
Returns an ImagePlus object with or without a ROI and with or without an overlay (if there are child objects)
lang=java
import ch.epfl.biop.qupath.utils.GUIUtils
def object = getSelectedObject()
def downsample = 4
def sendObject = false
def sendChildObjects = false
def imp = GUIUtils.getImagePlus( object, downsample, sendObject, sendChildObjects )
imp.show()
==== loadDisplaySettings(java.io.File fileToLoad) ====
Loads the display settings (Brightness, contrast, LUT, Min-Max) from a json serialized file created with **saveDisplaySettings()**
```lang=java
import ch.epfl.biop.qupath.utils.GUIUtils
def settingsDir = buildFilePath( PROJECT_BASE_DIR, "settings" )
mkdirs(settingsDir)
def loadFile = new File( settingsDir, 'CustomSettings.json')
GUIUtils.loadDisplaySettings( loadFile )
```
==== saveDisplaySettings(java.io.File fileToSave) ====
Saves the current display settings (Brightness, contrast, LUT, Min-Max) to a json serialized file that can be used with with **loadDisplaySettings()**
```lang=java
import ch.epfl.biop.qupath.utils.GUIUtils
def settingsDir = buildFilePath( PROJECT_BASE_DIR, "settings" )
mkdirs(settingsDir)
def saveFile = new File( settingsDir, 'CustomSettings.json')
GUIUtils.loadDisplaySettings( saveFile )
```
==== setActiveChannels(java.util.ArrayList<java.lang.Integer> theChannels) ====
Sets the channels in the list to active and deactivates the ones not in it
```lang=java
import ch.epfl.biop.qupath.utils.GUIUtils
def activeChannels = [1,3]
GUIUtils.setActiveChannels( activeChannels )
```
IMPORTANT: This command does not update the "Brightness and Contrast" window, which no longer reflects the current state until you change something
static void setActiveChannelsByName(java.util.ArrayList<java.lang.String> channelNames)
Sets the channels in the list to active and deactivated the ones not in it
static void setChannelColor(int channel, javafx.scene.paint.Color color)
Sets the color of the selected channel
static void setChannelColor(java.lang.String channelName, javafx.scene.paint.Color color)
Sets the color of the selected channel
static void setChannelMinMax(int channelID, int min, int max)
Sets the minimum and maximum display range for a channel, defined by its index (1 based)
static void setChannelMinMax(java.lang.String channelName, int min, int max)
Sets the minimum and maximum display range for a channel, defined by its name
static void setChannelsMinMax(java.util.List<java.lang.Integer> channelIndexes, java.util.List<java.lang.Integer> minValues, java.util.List<java.lang.Integer> maxValues)
c4science · Help