Skip to content

kstouff4/projective-lddmm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

####################################
Author: Kaitlin Stouffer
Last Update: 03/12/22

####################################

Description:
    This series of bash scripts call a number of python and matlab programs to estimate nonrigid and rigid transformations in 3D and 2D between high resolution 2D digital histology images and lower resolution 3D MRI. Input arguments and filenames are tailored to the particular data analyzed in the manuscript at (). Each module corresponding to a given step below can be run independently to accommodate different registration tasks.
    
    Steps 0-3 Estimate geometric and contrast transforms to achieve alignment of different imaging modalities.
    Steps 4-6 Build measure representations of data that can be resampled at different scales and depicted in 2D and 3D modes (i.e. bar graphs, smoothed surface renderings). Data used here was generated by training a UNET on manually annotated pathology. Training platform located at: https://github.com/twardlab/ADproject.

####################################

Args:
    -b brainNum (1 based digit)
    -o blockNum (1 based digit)
    -s step \in \{0,1\} denoting to estimate f() (0) or geometric transformations (1)
    -d date used as directory name
    -i iterations for estimating 3D geometric transformations
    -t stain name (in single quotes) \in \{'Amyloid','Tau'\}
    -f directory name (in single quotes) based on method of bias correction \in \{'itk','entropy','entropy_round2'\}
    -x suffix of bias corrected MRI slices (in single quotes) \in \{'','_pil'\}
    
###################################

Step 0: Merge individual segmentation images into one and generate surfaces. Save MRI coordinates.

../SurfaceTools/runSession2Analyze.sh /cis/home/kstouff4/Documents/datasets/exvivohuman_11T/more_blocks/Brain2/cchen_update.ses /cis/home/kstouff4/Documents/datasets/exvivohuman_11T/more_blocks/Brain2/3DSegmentations/redone_11222/ '\(all\|AD_Hip\)' 3

cd ../HistoMRIPipeline
matlab -nodisplay -r "get_MRICoords_by_katie('Brain2','1');pause(10);quit"

Step 1: Compute Transformations per block per brain of histology to MRI to initialize photometric transformation f(). f() will be saved as coefficients (1st degree). MRI 2D slices will be output, bias corrected, and saved with suffix given by -x.

./runFullPipeline.sh -b 2 -o 1 -s 0 -d 020222 -i 500 -t 'Tau' -f 'entropy' -x '_pil'

Step 2: Compute Algorithm 2A (estimate 3D rigid and non-rigid from initialization with fixed f() and 2D rigid). Then, fixing 3D rigid + non-rigid, compute 2D rigid + non-rigid. New MRI 2D slices will be output representative of new 3D transformations.

./runFullPipeline.sh -b 2 -o 1 -s 1 -d 020222 -i 500 -t 'Tau' -f 'entropy' -x '_pil'

Step 3: Compose Transformations from Step 2 with those combining blocks and rigidly aligning to Mai atlas. Transformations as well as deformed 3D segmentations to 2D will be saved for each set of high resolution histology pixels. VTK will be made for each slice to plot against CAD model (Step 4).

./runCompose.sh -b 2 -o 1 -d 020222 -t 'Tau' -f 'entropy_round2' -x '_pil'

Step 4: Make Measure representation of histology data. Compute jacobian weights for measure transport via transformations. Downsample histology data by 4 to define "finest" scale. Write out VTK files representing final location of each slice.

./runMakeMeasures.sh -b 2 -o 1 -d 020922 -t 'Tau' -f 'entropy_round2' -x '_pil' -r 'redone_11222' -s 1
./runMakeMeasures.sh -b 2 -o 1 -d 020922 -t 'Tau' -f 'entropy_round2' -x '_pil' -r 'redone_11222' -s 2
./runMakeMeasures.sh -b 2 -o 1 -d 020922 -t 'Tau' -f 'entropy_round2' -x '_pil' -r 'redone_11222' -s 4

Step 5: Re-sample region specific at finest scale. Make bar graph and rostral-caudal plots. Project to surface via Nearest Neighbor kernel. Smoothe over surface via Laplace-Beltrami.

./runMakeMeasures.sh -b 2 -o 1 -d 020922 -t 'Tau' -f 'entropy_round2' -x '_pil' -r 'redone_11222' -s 3
./runMakeMeasures.sh -b 2 -o 1 -d 020922 -t 'Tau' -f 'entropy_round2' -x '_pil' -r 'redone_11222' -s 5

Step 6: Re-sample region specific to coarser scale with Gaussian kernel to achieve intermediate resolution in Mai coordinates.

./runMakeMeasures.sh -b 2 -o 1 -d 020922 -t 'Tau' -f 'entropy_round2' -x '_pil' -r 'redone_11222' -s 7

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published