コード例 #1
0
parameter.Alignment.FixedImage  = os.path.join(basedirectory, 'Synthetic/test_iDISCO_reference.tif');
parameter.Alignment.FixedImageMask = None;
  
#elastix parameter files for alignment
parameter.Alignment.AffineParameterFile  = os.path.join(parameter.Alignment.AlignmentDirectory, 'ElastixParameterAffine.txt');
#parameter.Alignment.BSplineParameterFile = os.path.join(parameter.Alignment.AlignmentDirectory, 'ElastixParameterBSpline.txt');
parameter.Alignment.BSplineParameterFile = None;

runInitializeElastix(parameter)

runCellCoordinateTransformationToReference(parameter)

if verbose:
    refdata = io.readData(parameter.Alignment.FixedImage);
    pts = io.readPoints(parameter.ImageProcessing.CellTransformedCoordinateFile);
    Plot.plotOverlayPoints(0.01 * refdata, pts)




##############################################################################
# Test Voxelization
##############################################################################

import os

from iDISCO.Parameter import *
from iDISCO.Run import runVoxelization

import iDISCO.Visualization.Plot as Plot
import iDISCO.IO.IO as io
コード例 #2
0
runInitializeElastix(parameter)

#pts = io.readPoints(parameter.ImageProcessing.CellCoordinateFile);
#pts = pts[0:10000, :];
#pts[0,:] = [0,0,0];
#pts = pts[:, [1,0,2]];

runCellCoordinateTransformationToReference(parameter)

#pts2 = io.readPoints(parameter.ImageProcessing.CellTransformedCoordinateFile);
#pts2 = pts2[:,[1,0,2]];

if verbose:
    refdata = io.readData(parameter.Alignment.FixedImage)
    #pts = io.readPoints(parameter.ImageProcessing.CellTransformedCoordinateFile);
    Plot.plotOverlayPoints(0.1 * refdata, pts2)

refdata.shape

pts2 = io.readPoints(parameter.ImageProcessing.CellTransformedCoordinateFile)
#pts2 = pts2[:,[1,0,2]];
voximg = vox.voxelizePixel(pts2, refdata.shape)
io.writeDataStack(os.path.join(basedirectory, 'points_transformed_pixel.tif'),
                  voximg)

##############################################################################
# Test Resample Points
##############################################################################

import os
import numpy
コード例 #3
0
#pts = io.readPoints(parameter.ImageProcessing.CellCoordinateFile);
#pts = pts[0:10000, :];
#pts[0,:] = [0,0,0];
#pts = pts[:, [1,0,2]];

runCellCoordinateTransformationToReference(parameter)

#pts2 = io.readPoints(parameter.ImageProcessing.CellTransformedCoordinateFile);
#pts2 = pts2[:,[1,0,2]];


if verbose:
    refdata = io.readData(parameter.Alignment.FixedImage);
    #pts = io.readPoints(parameter.ImageProcessing.CellTransformedCoordinateFile);
    Plot.plotOverlayPoints(0.1 * refdata, pts2)


refdata.shape

pts2 = io.readPoints(parameter.ImageProcessing.CellTransformedCoordinateFile);
#pts2 = pts2[:,[1,0,2]];
voximg = vox.voxelizePixel(pts2, refdata.shape);
io.writeDataStack(os.path.join(basedirectory, 'points_transformed_pixel.tif'), voximg)






##############################################################################
コード例 #4
0
allParameter = joinParameter(stackProcessingParameter, spotDetectionParameter, {'x' : (100,160), 'y' : (10,140), 'z' : (2,38)})
#allParameter = joinParameter(stackProcessingParameter, spotDetectionParameter, {'x' : all, 'y' : all, 'z' : all})

result = detectCells(**allParameter);
print(result)

verbose = True;
if verbose:
    import iDISCO.IO.IO as io
    import iDISCO.Visualization.Plot as plot   
    
    dataraw = io.readData(spotDetectionParameter["source"]);
    dataraw[dataraw > 50] = 50;
    dataraw = dataraw.astype('float') / dataraw.max();
    points  = io.readPoints(spotDetectionParameter["sink"][0]);
    plot.plotOverlayPoints(dataraw, points, pointColor = [1,0,0]);


dataraw = io.readData(spotDetectionParameter["source"], x = (100,160), y = (10,140), z =  (2,38));
io.writeData( os.path.join(baseDirectory, 'Synthetic/raw.tif'), dataraw)

##############################################################################
# Test Resample Points
############################################################################## 

import os

import iDISCO.Settings as settings
import iDISCO.IO.IO as io
import iDISCO.Visualization.Plot as plot
コード例 #5
0
parameter.Alignment.FixedImage  = os.path.join(basedirectory, 'Synthetic/test_iDISCO_reference.tif');
parameter.Alignment.FixedImageMask = None;
  
#elastix parameter files for alignment
parameter.Alignment.AffineParameterFile  = os.path.join(parameter.Alignment.AlignmentDirectory, 'ElastixParameterAffine.txt');
#parameter.Alignment.BSplineParameterFile = os.path.join(parameter.Alignment.AlignmentDirectory, 'ElastixParameterBSpline.txt');
parameter.Alignment.BSplineParameterFile = None;

runInitializeElastix(parameter)

runCellCoordinateTransformationToReference(parameter)

if verbose:
    refdata = io.readData(parameter.Alignment.FixedImage);
    pts = io.readPoints(parameter.ImageProcessing.CellTransformedCoordinateFile);
    Plot.plotOverlayPoints(0.01 * refdata, pts)




##############################################################################
# Test Voxelization
##############################################################################

import os

from iDISCO.Parameter import *
from iDISCO.Run import runVoxelization

import iDISCO.Visualization.Plot as Plot
import iDISCO.IO.IO as io
コード例 #6
0
allParameter = joinParameter(stackProcessingParameter, spotDetectionParameter, {'x' : (100,160), 'y' : (10,140), 'z' : (2,38)})
#allParameter = joinParameter(stackProcessingParameter, spotDetectionParameter, {'x' : all, 'y' : all, 'z' : all})

result = detectCells(**allParameter);
print result

verbose = True;
if verbose:
    import iDISCO.IO.IO as io
    import iDISCO.Visualization.Plot as plot   
    
    dataraw = io.readData(spotDetectionParameter["source"]);
    dataraw[dataraw > 50] = 50;
    dataraw = dataraw.astype('float') / dataraw.max();
    points  = io.readPoints(spotDetectionParameter["sink"][0]);
    plot.plotOverlayPoints(dataraw, points, pointColor = [1,0,0]);


dataraw = io.readData(spotDetectionParameter["source"], x = (100,160), y = (10,140), z =  (2,38));
io.writeData( os.path.join(baseDirectory, 'Synthetic/raw.tif'), dataraw)

##############################################################################
# Test Resample Points
############################################################################## 

import os

import iDISCO.Settings as settings
import iDISCO.IO.IO as io
import iDISCO.Visualization.Plot as plot