Changeset 7310


Ignore:
Timestamp:
12/02/10 11:30:50 (9 years ago)
Author:
hinerm
Message:

Added code allowing jar paths and trailing slashes (or absence thereof) on the
ITK_AUTOLOAD_PATH to be OS-sensitive to windows and non-windows.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/native/bf-itk/itkBioFormatsImageIO.cxx

    r7281 r7310  
    6969#include <stdlib.h> 
    7070 
     71#if defined (_WIN32) 
     72#define PATHSTEP ';' 
     73#define SLASH '\' 
     74#else 
     75#define PATHSTEP ':' 
     76#define SLASH '/' 
     77#endif 
     78 
    7179//-------------------------------------- 
    7280// 
     
    100108        } 
    101109 
    102         if( dir.at(dir.length() - 1) != '/' ) { 
    103           dir.append(1,'/'); 
     110        if( dir.at(dir.length() - 1) != SLASH ) { 
     111          dir.append(1,SLASH); 
    104112        }  
    105113 
    106114        list.push_back(jace::ClassPath( 
    107         dir+"jace-runtime.jar:"+dir+"bio-formats.jar:"+dir+"loci_tools.jar" 
     115        dir+"jace-runtime.jar"+PATHSTEP+dir+"bio-formats.jar"+PATHSTEP+dir+"loci_tools.jar" 
    108116        )); 
    109117        list.push_back(jace::CustomOption("-Xcheck:jni")); 
    110118        list.push_back(jace::CustomOption("-Xmx256m")); 
    111119        list.push_back(jace::CustomOption("-Djava.awt.headless=true")); 
     120        list.push_back(jace::CustomOption("-Djava.library.path=" + dir)); 
    112121        //list.push_back(jace::CustomOption("-verbose")); 
    113122        //list.push_back(jace::CustomOption("-verbose:jni")); 
     
    287296 
    288297      // get physical resolution 
    289       double physX = 1, physY = 1; 
     298      double physX = 1, physY = 1, physZ = 1, timeIncrement = 1; 
    290299      // CTR - avoid invalid memory access error on some systems (OS X 10.5) 
    291300      //MetadataRetrieve retrieve = MetadataTools::asRetrieve(omeMeta); 
    292301      //physX = retrieve.getPixelsPhysicalSizeX(0).doubleValue(); 
    293302      //physY = retrieve.getPixelsPhysicalSizeY(0).doubleValue(); 
     303      //physZ = retrieve.getPixelsPhysicalSizeZ(0).doubleValue(); 
     304      //timeIncrement = retrieve.getPixelsTimeIncrement(0).doubleValue(); 
    294305      m_Spacing[0] = physX; 
    295306      m_Spacing[1] = physY; 
    296       if (imageCount > 1) m_Spacing[2] = 1; 
    297  
    298       itkDebugMacro("Physical resolution = " << physX << " x " << physY); 
     307      // TODO: verify m_Spacing.length > 2 
     308      if (imageCount > 1) m_Spacing[2] = physZ; 
     309      m_Spacing[3] = timeIncrement; 
     310 
     311      itkDebugMacro("Physical resolution = " << physX << " x " << physY 
     312        << " x " << physZ << " x " << timeIncrement); 
    299313    } 
    300314    catch (Exception& e) { 
Note: See TracChangeset for help on using the changeset viewer.