Package qupath.ext.biop.utils
Class Channels
java.lang.Object
qupath.ext.biop.utils.Channels
Channels class to handle loading and saving channel settings
It can modify channels based on either a simple text file or a string of the type
position, name, color, minDisplay, maxDisplay
eg.
1, First, #0300ff, 0, 100 3, Third, #ff3300, 10, 1200Also includes the possibility to save the settings to a textfile in the above format.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<qupath.ext.biop.utils.Channels.Channel> Return the current channel names, colors and minMax displays to a list NOTE: Channels that are not currently selected will not be sentstatic List<qupath.ext.biop.utils.Channels.Channel> readChannelSettings(File settingsFile) Read the settings from a simple text file, generally made usingwriteChannelSettings(List, File)but could also be made manuallystatic List<qupath.ext.biop.utils.Channels.Channel> readChannelSettings(String settingsString) Read the parameters of a simple string with each line formatted as: position, name, color, minDisplay, maxDisplay eg.static voidsetChannelSettings(File settingsFile) Set the channels directly from a text filestatic voidsetChannelSettings(List<qupath.ext.biop.utils.Channels.Channel> channels) This method actually sets the channel displays based on the channels list.static voidwriteChannelSettings(List<qupath.ext.biop.utils.Channels.Channel> channelSettings, File settingsFile) Write the provided Channels to a file
-
Constructor Details
-
Channels
public Channels()
-
-
Method Details
-
setChannelSettings
Set the channels directly from a text file- Parameters:
settingsFile- the file containing the channel settings, generally produced usingwriteChannelSettings(List, File)
-
setChannelSettings
This method actually sets the channel displays based on the channels list.- Parameters:
channels- the list of channels, created withreadChannelSettings(File),getCurrentChannelSettings()orreadChannelSettings(String)
-
getCurrentChannelSettings
Return the current channel names, colors and minMax displays to a list NOTE: Channels that are not currently selected will not be sent- Returns:
- a list that can be used with
writeChannelSettings(List, File)orsetChannelSettings(List)
-
readChannelSettings
public static List<qupath.ext.biop.utils.Channels.Channel> readChannelSettings(String settingsString) Read the parameters of a simple string with each line formatted as: position, name, color, minDisplay, maxDisplay eg.1, One channel, #0300ff, 0, 100 3, Another channel, #ff3300, 10, 1200
- Parameters:
settingsString- a manually created String- Returns:
- a list that can be used with
writeChannelSettings(List, File)orsetChannelSettings(List)
-
readChannelSettings
public static List<qupath.ext.biop.utils.Channels.Channel> readChannelSettings(File settingsFile) throws FileNotFoundException Read the settings from a simple text file, generally made usingwriteChannelSettings(List, File)but could also be made manually- Parameters:
settingsFile- the file with the settings.- Returns:
- a list that can be used with
writeChannelSettings(List, File)orsetChannelSettings(List) - Throws:
FileNotFoundException- in case the file does not exist
-
writeChannelSettings
public static void writeChannelSettings(List<qupath.ext.biop.utils.Channels.Channel> channelSettings, File settingsFile) throws IOException Write the provided Channels to a file- Parameters:
channelSettings- settings, obtained usingreadChannelSettings(String),readChannelSettings(File)orgetCurrentChannelSettings()settingsFile- a file that will be created or overwritten with the settings converted to text.- Throws:
IOException- in case the file cannot be written
-