SIVIC API  0.9.26
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
svkUtils Class Reference

#include <svkUtils.h>

Inheritance diagram for svkUtils:

Public Member Functions

 vtkTypeMacro (svkUtils, vtkObject)
 

Static Public Member Functions

static svkUtilsNew ()
 
static bool FilePathExists (const char *path)
 Does the file or path exist: More...
 
static string GetCurrentWorkingDirectory ()
 
static string GetHomeDirectory ()
 
static string GetUserName ()
 
static bool CanWriteToPath (const char *path)
 
static int CopyFile (const char *input, const char *output)
 
static int MoveFile (const char *input, const char *output)
 
static bool PrintFile (const char *fileName, const char *printerName)
 
static vector< string > GetFileNamesFromPattern (string imageBaseName, int startSlice, int endSlice)
 
static string GetDefaultSecondaryCaptureDirectory (svkMriImageData *image, svk4DImageData *spectra)
 
static string GetDefaultSecondaryCaptureFilePattern (svkMriImageData *image, svk4DImageData *spectra)
 
static int GetNextPower2 (int x)
 
static void StringToColorArray (double color[3], string colorString)
 
static string Double3x3ToString (double doubleMatrix[][3])
 
static string ColorArrayToString (double color[3])
 
static vector< string > SplitString (string str, string token)
 
static string GetFilenameFromFullPath (string fullPath)
 
static int NearestInt (double x)
 
static bool UncompressFiles (vtkStringArray *filenames)
 
static bool UncompressFile (vtkstd::string filename)
 
static bool IsFileCompressed (vtkstd::string filename)
 
static string SpacesTo_ (string inputString)
 
static bool AreValuesClose (double x, double y, double maxRatio=0.01)
 
static bool AreValuesClose (double x[3], double y[3], double maxRatio=0.01)
 
static int GetNumberOfDigits (int value, bool isMinusDigit=false)
 
static void GetRealpath (const char *path, int size, char *realpath)
 
static void ReadLine (ifstream *fs, istringstream *iss)
 

Protected Member Functions

 svkUtils ()
 Constructor. More...
 
 ~svkUtils ()
 Destructor. More...
 

Detailed Description

UCSF specific utilities.

Constructor & Destructor Documentation

svkUtils ( )
protected

Constructor.

~svkUtils ( )
protected

Destructor.

Member Function Documentation

bool AreValuesClose ( double  x,
double  y,
double  maxRatio = 0.01 
)
static

Used to test for minor differences in values.

Referenced by svkDataValidator::AreDataSpacingsSame(), and svkUtils::AreValuesClose().

bool AreValuesClose ( double  x[3],
double  y[3],
double  maxRatio = 0.01 
)
static

Used to test for minor differences in values.

References svkUtils::AreValuesClose().

bool CanWriteToPath ( const char *  path)
static

Checks to see if a file, or path exists.

Referenced by svkGEConsolePACSInterface::Connect(), and svkUCSFPACSInterface::Connect().

string ColorArrayToString ( double  color[3])
static
int CopyFile ( const char *  input,
const char *  output 
)
static
string Double3x3ToString ( double  doubleMatrix[][3])
static
Parameters
doubleVal
Returns
string equivalent
bool FilePathExists ( const char *  path)
static

Does the file or path exist:

Checks to see if a file, or path exists.

Referenced by svkF2C::GetIDFHeader(), svkImageAlgorithmPipeline::InitializeAlgorithmForTag(), and svkAlgorithmPortMapper::SetMRImageInputPortValue().

string GetCurrentWorkingDirectory ( )
static

Get the current working directory.

string GetDefaultSecondaryCaptureDirectory ( svkMriImageData image,
svk4DImageData activeData 
)
static

Generates a derectory based on the series and series number sof the image and spectra. Used for pushing to PACS.

References svkImageData::GetDcmHeader(), and svkDcmHeader::GetIntValue().

string GetDefaultSecondaryCaptureFilePattern ( svkMriImageData image,
svk4DImageData activeData 
)
static

Generates a derectory based on the series and series number sof the image and activeData. Used for pushing to PACS.

References svkImageData::GetDcmHeader(), and svkDcmHeader::GetStringValue().

string GetFilenameFromFullPath ( string  fullPath)
static

Returns the string following final slash. This could be a filename or terminal directory.

References svkUtils::SplitString().

Referenced by svkGEConsolePACSInterface::SendImagesToPACS().

vector< string > GetFileNamesFromPattern ( string  imageBaseName,
int  startSlice,
int  endSlice 
)
static

Moves all image slices from one location to another. Either * in the imageBaseName will be replaced with the slice number or a number will be inserted before the extention.

string GetHomeDirectory ( )
static

Returns the users home diretory.

Referenced by svkQuantifyMetabolites::GetDefaultXMLFileName().

int GetNextPower2 ( int  x)
static

Returns the next highest power of two greater than the input x.

Referenced by svkMrsZeroFill::RequestInformation().

int GetNumberOfDigits ( int  number,
bool  isMinusDigit = false 
)
static

Get the number of digits in an integer. Minus sign counts as a digit in this case.

void GetRealpath ( const char *  path,
int  size,
char *  resultRealpath 
)
static

Method expands relative paths.

string GetUserName ( )
static
bool IsFileCompressed ( vtkstd::string  filename)
static

Check to see if a file is compressed. Platform dependent, currently not supported on windows.

Referenced by svkUtils::UncompressFile().

int MoveFile ( const char *  input,
const char *  output 
)
static

Move a file.

References svkUtils::CopyFile().

int NearestInt ( double  x)
static
static svkUtils* New ( )
static
bool PrintFile ( const char *  fileName,
const char *  printerName 
)
static

Print a file. Not yet supported in Windows.

void ReadLine ( ifstream *  fs,
istringstream *  iss 
)
static

Utility function to read a single line from a file stream.

string SpacesTo_ ( string  inputString)
static

This method replaces spaces with underscores (_). Spaces are not permitted in strings used through the tcl layer so if we want to use a string as a variable in this way then the spaces must be extracted.

vector< string > SplitString ( string  str,
string  token 
)
static
void StringToColorArray ( double  color[3],
string  colorString 
)
static
bool UncompressFile ( vtkstd::string  filename)
static

Uncompress a file. Platform dependent, currently not supported on windows.

References svkUtils::IsFileCompressed().

Referenced by svkUtils::UncompressFiles().

bool UncompressFiles ( vtkStringArray *  filenames)
static

Uncompress all files given.

References svkUtils::UncompressFile().

vtkTypeMacro ( svkUtils  ,
vtkObject   
)

The documentation for this class was generated from the following files: