Package sc.fiji.snt
Class SNTPrefs
java.lang.Object
sc.fiji.snt.SNTPrefs
Class handling SNT preferences.
- Author:
- Tiago Ferreira
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclearAll()booleanCreates workspace directory if it doesn't exist.static booleanChecks if this is the first run after an SNT update.Gets a string preference value.protected intReturns the backup directory, or null if workspace doesn't exist.booleangetBoolean(String key, boolean defaultValue) Gets a boolean preference value.static Stringprotected Pointstatic StringGets the current look and feel preference.Returns the list of filename suffixes used to identify images when navigating to the next/previous image in a folder (seeSNTUI).protected PointReturns the sessions directory, or null if workspace doesn't exist.booleanGets a temporary boolean preference value that will be cleared at session end.Gets a temporary string preference value that will be cleared at session end.static intGets the current number of threads setting.booleanChecks if 2D display canvas is forced.booleanChecks if traces should be saved in compressed format.booleanChecks if window locations should be saved and restored.booleanSets whether single-node paths tagged as are rendered w/ triangular shape.static Fileprotected voidprotected voidDeprecated.protected voidprotected voidsavePluginPrefs(boolean restoreIJ1prefs) protected voidDeprecated.voidSets a boolean preference value.voidSets a string preference value.voidset2DDisplayCanvas(boolean bool) Sets whether to force 2D display canvas.protected voidset3DViewerResamplingFactor(int factor) voidsetAutosaveFile(File file) protected static voidsetFirstRunAfterUpdate(boolean b) static voidsetLastKnownDir(File file) static voidsetLookAndFeel(String laf) Sets the look and feel preference.voidsetNextImgExtensions(String csvString) Convenience method for setting filename suffixes from a comma-separated string.voidsetNextImgExtensions(List<String> extensions) Sets the list of filename suffixes used to identify images when navigating to the next/previous image in a folder.voidsetRecentDir(File file) voidsetSaveCompressedTraces(boolean bool) Sets whether to save traces in compressed format.voidsetSaveWinLocations(boolean value) Sets whether window locations should be saved and restored.voidsetSomaDisplayTriangle(boolean bool) Sets whether single-node paths tagged as soma should render w/ triangular shape.voidSets a temporary boolean preference value that will be cleared at session end.voidSets a temporary string preference value that will be cleared at session end.static voidsetThreads(int n) Sets the number of threads to use for multi-threaded operations.voidsetWorkspaceDir(File dir) boolean
-
Field Details
-
NO_IMAGE_ASSOCIATED_DATA
- See Also:
-
RESIZE_REQUIRED
- See Also:
-
RESTORE_LOADED_IMGS
- See Also:
-
AUTOSAVE_KEY
- See Also:
-
SPLIT_FILLS_KEY
- See Also:
-
BVV_RENDER_WIDTH
- See Also:
-
BVV_RENDER_HEIGHT
- See Also:
-
BVV_MAX_RENDER_MILLIS
- See Also:
-
BVV_MAX_STEP_IN_VOXELS
- See Also:
-
MAX_UNDO_STEPS
public static int MAX_UNDO_STEPS
-
-
Constructor Details
-
SNTPrefs
Constructs a new SNTPrefs instance for the specified SNT instance.- Parameters:
snt- the SNT instance to manage preferences for
-
-
Method Details
-
get3DViewerResamplingFactor
protected int get3DViewerResamplingFactor() -
set3DViewerResamplingFactor
protected void set3DViewerResamplingFactor(int factor) -
getBoolean
Gets a boolean preference value.- Parameters:
key- the preference keydefaultValue- the default value if the key is not found- Returns:
- the boolean preference value
-
get
Gets a string preference value.- Parameters:
key- the preference keydefaultValue- the default value if the key is not found- Returns:
- the string preference value
-
set
Sets a string preference value.- Parameters:
key- the preference keyvalue- the value to set
-
set
Sets a boolean preference value.- Parameters:
key- the preference keydefaultValue- the value to set
-
getTemp
Gets a temporary boolean preference value that will be cleared at session end.- Parameters:
key- the preference keydefaultValue- the default value if the key is not found- Returns:
- the boolean preference value
-
setTemp
Sets a temporary boolean preference value that will be cleared at session end.- Parameters:
key- the preference keyvalue- the value to set
-
getTemp
Gets a temporary string preference value that will be cleared at session end.- Parameters:
key- the preference keydefaultValue- the default value if the key is not found- Returns:
- the string preference value
-
setTemp
Sets a temporary string preference value that will be cleared at session end.- Parameters:
key- the preference keyvalue- the value to set
-
getAutosaveFile
-
setAutosaveFile
-
loadPluginPrefs
protected void loadPluginPrefs() -
loadStartupPrefs
Deprecated. -
saveStartupPrefs
Deprecated. -
savePluginPrefs
protected void savePluginPrefs(boolean restoreIJ1prefs) -
is2DDisplayCanvas
public boolean is2DDisplayCanvas()Checks if 2D display canvas is forced.- Returns:
- true if 2D display canvas is forced, false otherwise
-
set2DDisplayCanvas
public void set2DDisplayCanvas(boolean bool) Sets whether to force 2D display canvas.- Parameters:
bool- true to force 2D display canvas, false otherwise
-
isSaveCompressedTraces
public boolean isSaveCompressedTraces()Checks if traces should be saved in compressed format.- Returns:
- true if compressed traces are enabled, false otherwise
-
setSaveCompressedTraces
public void setSaveCompressedTraces(boolean bool) Sets whether to save traces in compressed format.- Parameters:
bool- true to enable compressed traces, false otherwise
-
isSomaDisplayTriangle
public boolean isSomaDisplayTriangle()Sets whether single-node paths tagged as are rendered w/ triangular shape.- Returns:
- true if triangular shape is enable, false otherwise
-
setSomaDisplayTriangle
public void setSomaDisplayTriangle(boolean bool) Sets whether single-node paths tagged as soma should render w/ triangular shape.- Parameters:
bool- true to enable triangular shape, false for default representation
-
isSaveWinLocations
public boolean isSaveWinLocations()Checks if window locations should be saved and restored.- Returns:
- true if window locations are saved, false otherwise
-
setSaveWinLocations
public void setSaveWinLocations(boolean value) Sets whether window locations should be saved and restored.- Parameters:
value- true to save window locations, false otherwise
-
setFirstRunAfterUpdate
protected static void setFirstRunAfterUpdate(boolean b) -
firstRunAfterUpdate
public static boolean firstRunAfterUpdate()Checks if this is the first run after an SNT update.- Returns:
- true if this is the first run after an update, false otherwise
-
setThreads
public static void setThreads(int n) Sets the number of threads to use for multi-threaded operations.- Parameters:
n- the number of threads (if less than 1, uses available processors)
-
getLookAndFeel
Gets the current look and feel preference.- Returns:
- the look and feel class name
-
setLookAndFeel
Sets the look and feel preference.- Parameters:
laf- the look and feel class name
-
getThreads
public static int getThreads()Gets the current number of threads setting.- Returns:
- the number of threads
-
getPathWindowLocation
-
getFillWindowLocation
-
resetOptions
protected void resetOptions() -
clearAll
public static void clearAll() -
getDefaultLookAndFeel
-
setRecentDir
-
getRecentDir
-
getWorkspaceDir
-
setWorkspaceDir
-
getBackupDir
Returns the backup directory, or null if workspace doesn't exist. Does NOT create directories. -
ensureWorkspaceExists
public boolean ensureWorkspaceExists()Creates workspace directory if it doesn't exist.- Returns:
- true if directory exists or was created successfully
-
workspaceIsValid
public boolean workspaceIsValid()- Returns:
- true if workspace directory exists and has write permissions.
-
getSessionsDir
Returns the sessions directory, or null if workspace doesn't exist. Does NOT create directories. -
lastKnownDir
-
setLastKnownDir
-
getNextImgExtensions
Returns the list of filename suffixes used to identify images when navigating to the next/previous image in a folder (seeSNTUI). Matching is case-insensitive and applied to the end of the filename (i.e.,endsWith). Suffixes may include a leading dot (e.g.,".tif") or a partial filename suffix (e.g.,"_max.tif").- Returns:
- a non-null, non-empty list of suffixes; defaults to
[".tif", ".tiff"]if no preference has been set
-
setNextImgExtensions
Sets the list of filename suffixes used to identify images when navigating to the next/previous image in a folder. Null, blank, and empty entries are silently ignored. If the resulting cleaned list is empty ornullis passed, the preference is cleared and the default ([".tif", ".tiff"]) will be used on the next call togetNextImgExtensions().- Parameters:
extensions- the list of suffixes to store (e.g.,[".tif", ".png"]); may benullto reset to defaults- See Also:
-
setNextImgExtensions
Convenience method for setting filename suffixes from a comma-separated string. Whitespace around entries is trimmed and blank entries are ignored. Delegates tosetNextImgExtensions(List).- Parameters:
csvString- a comma-separated string of filename suffixes (e.g.,".tif, .tiff, .png"); may benullor empty to reset to defaults- See Also:
-