public class SNTUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
addViewer(Viewer3D viewer) |
static String |
buildDate()
Retrieves Sholl Analysis implementation date
|
protected static void |
convertTo32bit(ij.ImagePlus imp) |
static void |
convertTo8bit(ij.ImagePlus imp) |
static void |
csvQuoteAndPrint(PrintWriter pw,
Object o) |
static void |
error(String string) |
static void |
error(String string,
Throwable t) |
protected static boolean |
fileAvailable(File file) |
static File |
findClosestPair(File file,
String pairExt) |
static File |
findClosestPair(File file,
String[] pairExts) |
static String |
formatDouble(double value,
int digits) |
protected static Color |
getColor(String colorName) |
protected static String |
getColorString(Color color) |
static Context |
getContext()
Convenience method to access the context of the running Fiji instance (mainly
for IJ1 plugins.
|
static DecimalFormat |
getDecimalFormat(double value,
int digits) |
static String |
getElapsedTime(long fromStart) |
static ij.process.LUT |
getLut(ColorTable cTable) |
static ij.ImagePlus |
getMIP(ij.ImagePlus imp) |
static SNT |
getPluginInstance() |
static String |
getReadableVersion() |
static File[] |
getReconstructionFiles(File dir,
String pattern)
Retrieves a list of reconstruction files stored in a common directory
matching the specified criteria.
|
static String |
getSanitizedUnit(String unit) |
static File |
getUniquelySuffixedFile(File referenceFile) |
static File |
getUniquelySuffixedTifFile(File referenceFile) |
protected static HashMap<Integer,Viewer3D> |
getViewers() |
static boolean |
isDebugMode()
Assesses if SNT is running in debug mode
|
protected static boolean |
isValidURL(String url) |
static void |
log(String string) |
protected static void |
nonDebugError(String string) |
static List<Path> |
randomPaths()
Generates a list of random paths.
|
static void |
removeViewer(Viewer3D viewer) |
static void |
saveTable(Table<?,?> table,
char columnSep,
boolean saveColHeaders,
boolean saveRowHeaders,
File outputFile) |
static void |
setContext(Context context) |
static void |
setDebugMode(boolean b)
Enables/disables debug mode
|
static void |
setIsLoading(boolean isLoading) |
protected static void |
setPlugin(SNT plugin) |
static boolean |
similarCalibrations(ij.measure.Calibration a,
ij.measure.Calibration b) |
static String |
stripExtension(String filename) |
protected static void |
warn(String string) |
public static final String VERSION
public static String getReadableVersion()
public static void addViewer(Viewer3D viewer)
public static void removeViewer(Viewer3D viewer)
public static void error(String string)
protected static void setPlugin(SNT plugin)
public static SNT getPluginInstance()
protected static void nonDebugError(String string)
public static void log(String string)
protected static void warn(String string)
protected static void convertTo32bit(ij.ImagePlus imp) throws IllegalArgumentException
IllegalArgumentException
public static void convertTo8bit(ij.ImagePlus imp)
public static ij.ImagePlus getMIP(ij.ImagePlus imp)
public static void csvQuoteAndPrint(PrintWriter pw, Object o)
public static void saveTable(Table<?,?> table, char columnSep, boolean saveColHeaders, boolean saveRowHeaders, File outputFile) throws IOException
IOException
protected static boolean fileAvailable(File file)
protected static boolean isValidURL(String url)
public static String formatDouble(double value, int digits)
public static DecimalFormat getDecimalFormat(double value, int digits)
public static boolean isDebugMode()
public static void setDebugMode(boolean b)
b
- verbose flagpublic static boolean similarCalibrations(ij.measure.Calibration a, ij.measure.Calibration b)
public static List<Path> randomPaths()
public static ij.process.LUT getLut(ColorTable cTable)
public static String getElapsedTime(long fromStart)
public static String buildDate()
public static File[] getReconstructionFiles(File dir, String pattern)
dir
- the directory containing the reconstruction files (.(e)swc,
.traces, .json extension)pattern
- the filename substring (case sensitive) to be matched. Only
filenames containing pattern
will be imported from the
directory. null
allowed.dir
is not a
valid, readable directory.public static void setIsLoading(boolean isLoading)
public static Context getContext()
public static void setContext(Context context)
Copyright © 2015–2021 Fiji. All rights reserved.