basedirectory = os.path.join(iDISCOPath(), 'Test');

verbose = True;

resultdir = os.path.join(basedirectory, 'Synthetic/elastix');
transformfile = elx.getTransformParameterFile(resultdir)

# tranform points according to alignment of data and reference 
resamplefile = os.path.join(basedirectory, 'Synthetic/test_iDISCO_reference.tif');
transformdir = os.path.join(basedirectory, 'Synthetic/transformix')

elx.initializeElastix('/home/ckirst/programs/elastix')
elx.ElastixSettings.printInfo()

#elx.transformData(dataresname, alignmentdirectory = resultdir, outdirectory = dataalgname)
elx.transformData(resamplefile, transformparameterfile = os.path.join(basedirectory, 'Synthetic/elastix/TransformParameters.0.txt'), outdirectory = transformdir)
   


##############################################################################
# Transform Points from Raw Data to Reference
############################################################################## 

import os

from iDISCO.Parameter import *
from iDISCO.Run import runInitializeElastix, runCellCoordinateTransformationToReference


import iDISCO.Visualization.Plot as Plot
import iDISCO.IO.IO as io
basedirectory = '/home/mtllab/Documents/whiskers/2ndgroup/C'

resultdir = os.path.join(basedirectory, 'elastix_cfos_auto')
transformfile = elx.getTransformParameterFile(resultdir)

# tranform points according to alignment of data and reference
resamplefile = os.path.join(basedirectory, 'autofluo_for_cfos_resample.tif')
transformdir = os.path.join(basedirectory, 'transform_data_cfos_auto')

elx.initializeElastix('/usr/local/elastix')
elx.ElastixSettings.printInfo()

#elx.transformData(dataresname, alignmentdirectory = resultdir, outdirectory = dataalgname)
elx.transformData(resamplefile,
                  transformparameterfile=transformfile,
                  outdirectory=transformdir)

##############################################################################
# Transform Points from Cfos to Autofluo
##############################################################################

import os

from iDISCO.Parameter import *
from iDISCO.Run import runInitializeElastix, runCellCoordinateTransformationToReference
from iDISCO.Run import runCellCoordinateResampling, runCellCoordinateTransformation

import iDISCO.Visualization.Plot as Plot
import iDISCO.IO.IO as io
import iDISCO.IO.IO as io

basedirectory = '/home/mtllab/Documents/whiskers/2ndgroup/C';

resultdir = os.path.join(basedirectory, 'elastix_cfos_auto');
transformfile = elx.getTransformParameterFile(resultdir)

# tranform points according to alignment of data and reference 
resamplefile = os.path.join(basedirectory, 'autofluo_for_cfos_resample.tif');
transformdir = os.path.join(basedirectory, 'transform_data_cfos_auto')

elx.initializeElastix('/usr/local/elastix')
elx.ElastixSettings.printInfo()

#elx.transformData(dataresname, alignmentdirectory = resultdir, outdirectory = dataalgname)
elx.transformData(resamplefile, transformparameterfile = transformfile, outdirectory = transformdir)
   








##############################################################################
# Transform Points from Cfos to Autofluo
############################################################################## 

import os
baseDirectory = os.path.join(settings.IDISCOPath,  'Test');

verbose = True;

transformDirectory = os.path.join(baseDirectory, 'Synthetic/elastix');
transformFile      = elx.getTransformParameterFile(transformDirectory)

# tranform points according to alignment of data and reference 
resampleFile    = os.path.join(baseDirectory, 'Synthetic/test_iDISCO_resample.tif');
referenceFile    = os.path.join(baseDirectory, 'Synthetic/test_iDISCO_reference.tif');

resultDirectory = os.path.join(baseDirectory, 'Synthetic/transformix')

#elx.transformData(dataresname, alignmentdirectory = resultdir, outdirectory = dataalgname)
resultFile = elx.transformData(referenceFile, transformDirectory = transformDirectory, resultDirectory = resultDirectory)

if verbose:
    resampledata  = io.readData(resampleFile);
    referencedata = io.readData(referenceFile);
    transformdata = io.readData(resultFile);

    print(resampledata.shape)
    print(referencedata.shape)
    print(transformdata.shape)

    plot.plotTiling(0.01 * resampledata)
    plot.plotTiling(0.01 * referencedata)
    plot.plotTiling(0.01 * transformdata)    

Example #5
0
basedirectory = os.path.join(iDISCOPath(), 'Test');

verbose = True;

resultdir = os.path.join(basedirectory, 'Synthetic/elastix');
transformfile = elx.getTransformParameterFile(resultdir)

# tranform points according to alignment of data and reference 
resamplefile = os.path.join(basedirectory, 'Synthetic/test_iDISCO_reference.tif');
transformdir = os.path.join(basedirectory, 'Synthetic/transformix')

elx.initializeElastix('/home/ckirst/programs/elastix')
elx.ElastixSettings.printInfo()

#elx.transformData(dataresname, alignmentdirectory = resultdir, outdirectory = dataalgname)
elx.transformData(resamplefile, transformparameterfile = os.path.join(basedirectory, 'Synthetic/elastix/TransformParameters.0.txt'), outdirectory = transformdir)
   


##############################################################################
# Transform Points from Raw Data to Reference
############################################################################## 

import os

from iDISCO.Parameter import *
from iDISCO.Run import runInitializeElastix, runCellCoordinateTransformationToReference


import iDISCO.Visualization.Plot as Plot
import iDISCO.IO.IO as io
baseDirectory = os.path.join(settings.IDISCOPath,  'Test');

verbose = True;

transformDirectory = os.path.join(baseDirectory, 'Synthetic/elastix');
transformFile      = elx.getTransformParameterFile(transformDirectory)

# tranform points according to alignment of data and reference 
resampleFile    = os.path.join(baseDirectory, 'Synthetic/test_iDISCO_resample.tif');
referenceFile    = os.path.join(baseDirectory, 'Synthetic/test_iDISCO_reference.tif');

resultDirectory = os.path.join(baseDirectory, 'Synthetic/transformix')

#elx.transformData(dataresname, alignmentdirectory = resultdir, outdirectory = dataalgname)
resultFile = elx.transformData(referenceFile, transformDirectory = transformDirectory, resultDirectory = resultDirectory)

if verbose:
    resampledata  = io.readData(resampleFile);
    referencedata = io.readData(referenceFile);
    transformdata = io.readData(resultFile);

    print resampledata.shape
    print referencedata.shape
    print transformdata.shape    

    plot.plotTiling(0.01 * resampledata)
    plot.plotTiling(0.01 * referencedata)
    plot.plotTiling(0.01 * transformdata)