Search
Generating SWC Files

ShuTu was one of the two ways initially experimented for the BioImage 2019 brightfield challenge. This notebook demonstrates how to use ShuTu to generate SWC files, running on Colab. This notebook essentially recreates the SWC generating part of the ShuTu tutorial, on Colab.

This notebook uses ShuTu's sample data; it does not use Allen Institute data. This just proves that ShuTu can run on Colab.

ShuTu documentation

ShuTu is two tools in one

ShuTu has two separately usable components.

  1. ShuTu SWC generator is a CLI tool, which makes SWC files.
  2. ShuTu SWC editor is a cross-platform GUI desktop application.

The SWC generator can be deployed on Colab. The SWC editor cannot; the editor is desktop application, not a Jupyter component.

Install ShuTu

This next cell is from the ShuTu tutorial and build.sh, combined into one cell specifically for install and build on Colab.

%%shell

# Get the Linux distro of ShuTu (took less than a minute to DL)
wget https://psu.box.com/shared/static/wszpq3r6hwgoxo8eq0vb1k82fwrabycl.zip
unzip wszpq3r6hwgoxo8eq0vb1k82fwrabycl.zip # creates ShuTuUbuntu directory

#set -m # needed to avoid error: bash: no job control in this shell
cd ShuTuUbuntu

##########
# This next part is from build.sh.
#
#export PATH=$downloadDir/local/bin:$PATH
cd mylib
make
cd ..
make

Install test data from ShuTu tutorial

The real goal is to use ShuTu on the BioImage challenge dataset from The Allen. But a good sanity checker is to use the granule cell example data from the ShuTu tutorial, as described in section, "Image processing and automated reconstruction", quoting:

Download the image files from Granule Cell 63X Start. Unzip in the home directory, which should create a directory granuleCell63XStart.

Specifically, the link behind "Granule Cell 63X Start" is: https://psu.box.com/shared/static/f4gs13fs0y9ckrjjo78oid7hkv61k2wq.zip

It takes about a minute to download the 1.3G granule cell sample data.

# This is a 1.3GB image stack for use in skeletonization (make a SWC file). 
# Downloads in less than 2 minutes
!wget https://psu.box.com/shared/static/f4gs13fs0y9ckrjjo78oid7hkv61k2wq.zip
!unzip f4gs13fs0y9ckrjjo78oid7hkv61k2wq.zip

Seems there are 520 *.tif files in the sample data set.

!ls /content/granuleCell63XStart/slides/*.tif | wc -l
520

Generate the sample data's SWC file

This next cell assumes the above cell was run, creating the directory /content/granuleCell63XStart/ used below, containing 4 tiff files that need to be processed.

This takes on the order of ten minutes (not precisely time yet)

%%shell
cd ShuTuUbuntu

mpirun --allow-run-as-root -n 1 ./createTiffStacksZeiss /content/granuleCell63XStart/ granule
mpirun --allow-run-as-root -n 1 processImages /content/granuleCell63XStart/
mpirun --allow-run-as-root -n 1 ./stitchTiles /content/granuleCell63XStart/
mpirun --allow-run-as-root -n 1 ./ShuTuAutoTrace /content/granuleCell63XStart/ ShuTu.Parameters.granule63XTest.dat # creates *.swc file
Creating tiff stacks from images and xml files in /content/granuleCell63XStart/ with finameCommon=granule
Number of tasks= 1 My rank= 0 Running on 8ddec874899d
Finding image slices with finames ending with _ORG.tif 
/content/granuleCell63XStart/
filenameSliceCommon=/content/granuleCell63XStart/slides/DG-151213-S1_63X_20percentOverlap_100617_redo_
nTiles=4 nz=130 zstart=6 zend=135
/content/granuleCell63XStart/granule-1.tif
/content/granuleCell63XStart/granule-2.tif
/content/granuleCell63XStart/granule-3.tif
/content/granuleCell63XStart/granule-4.tif
Bright field images
Number of tasks= 1 My rank= 0 Running on 8ddec874899d
ntiff=4 filenameCommon=/content/granuleCell63XStart/granule-
Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Save projection to /content/granuleCell63XStart/granule-1.Proj.tif
Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Save projection to /content/granuleCell63XStart/granule-4.Proj.tif
Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Save projection to /content/granuleCell63XStart/granule-3.Proj.tif
Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Save projection to /content/granuleCell63XStart/granule-2.Proj.tif
Number of tasks= 1 My rank= 0 Running on 8ddec874899d
Image dimension=(1040 1388 129) type=0 number of channels=3
ntiff=4 filenameCommon=/content/granuleCell63XStart/granule-
Parsing /content/granuleCell63XStart/DG-151213-S1_63X_20percentOverlap_100617_redo_info.xml for tile positions 
numTiles=4 nx=1388 ny=1040 nz=129
ID=2 X=1112 Y=0
ID=3 X=1112 Y=833
ID=4 X=0 Y=833
ID=1 X=1 Y=0
Computing offsets between 2 3 offset =75.096153 direction =down
 Stitching /content/granuleCell63XStart/granule-2.tif and /content/granuleCell63XStart/granule-3.tif. Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Smoothing in each plane... Bright field image. normalize maximum intensity to 1...Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Smoothing in each plane... Bright field image. normalize maximum intensity to 1...tcmalloc: large alloc 1073741824 bytes == 0x55e85b0ac000 @  0x7f1eaef081e7 0x55e7fe13ffa4 0x55e7fe1387df 0x7f1eae256b97 0x55e7fe136cba
Dimensions of overlapping stack nxx=512 nyy=2048 nzz=256. Computing phase correlation. Smoothing planes. Shifts dx=52 dy=-16 dz=0 maxcorr=0.026200. Convert shifts to offsets.
dx=833 dy=-16 dz=0 maxCorr=0.026200
Computing offsets between 2 1 offset =75.043228 direction =left
 Stitching /content/granuleCell63XStart/granule-2.tif and /content/granuleCell63XStart/granule-1.tif. Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Smoothing in each plane... Bright field image. normalize maximum intensity to 1...Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Smoothing in each plane... Bright field image. normalize maximum intensity to 1...Dimensions of overlapping stack nxx=2048 nyy=512 nzz=256. Computing phase correlation. Smoothing planes. Shifts dx=-21 dy=-72 dz=2 maxcorr=0.015550. Convert shifts to offsets.
dx=-21 dy=-1114 dz=2 maxCorr=0.015550
Computing offsets between 3 4 offset =75.115273 direction =left
 Stitching /content/granuleCell63XStart/granule-3.tif and /content/granuleCell63XStart/granule-4.tif. Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Smoothing in each plane... Bright field image. normalize maximum intensity to 1...Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Smoothing in each plane... Bright field image. normalize maximum intensity to 1...Dimensions of overlapping stack nxx=2048 nyy=512 nzz=256. Computing phase correlation. Smoothing planes. Shifts dx=-21 dy=-72 dz=2 maxcorr=0.015873. Convert shifts to offsets.
dx=-21 dy=-1115 dz=2 maxCorr=0.015873
Computing offsets between 4 1 offset =75.096153 direction =up
 Stitching /content/granuleCell63XStart/granule-4.tif and /content/granuleCell63XStart/granule-1.tif. Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Smoothing in each plane... Bright field image. normalize maximum intensity to 1...Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Smoothing in each plane... Bright field image. normalize maximum intensity to 1...Dimensions of overlapping stack nxx=512 nyy=2048 nzz=256. Computing phase correlation. Smoothing planes. Shifts dx=-52 dy=17 dz=0 maxcorr=0.021515. Convert shifts to offsets.
dx=-833 dy=17 dz=0 maxCorr=0.021515
Connected 2 3
Connected 4 1
Connected 3 4
connect tiles 2 3
/content/granuleCell63XStart/stitchRes.2.3.txt
 833 -16 0
connect tiles 3 4
/content/granuleCell63XStart/stitchRes.3.4.txt
 -21 -1115 2
connect tiles 4 1
/content/granuleCell63XStart/stitchRes.4.1.txt
 -833 17 0
21 1131 0
854 1115 0
833 0 2
0 17 2
Image dimension=(1040 1388 1) type=0 number of channels=3
Saving combined projection image to /content/granuleCell63XStart/granule-.flatCombined.tif
Saving the coordinates to /content/granuleCell63XStart/granule-.StitchCoord.txt
Writing the json file for the reconstruction GUI /content/granuleCell63XStart/granule-.tiles.json
granule-
Number of tasks= 1 My rank= 0 Running on 8ddec874899d
Tracing neuron from tif stacks in /content/granuleCell63XStart/
Reading parameters from file ShuTu.Parameters.granule63XTest.dat
The important parameters are:
1. xyDist		= 0.103 micron
2. zDist		= 0.500 micron
3. nSplit		=1
4. sparse		= 0.100
5. levelSetIter		=500
6. smallLen		=9 pixel
7. zJumpFact		= 5.000
8. distFactConn		= 2.000
9. minDistConn		=29.126 pixels
10. angle		=60.000 degree
11. searchMax		=48.544
12. factSigmaDD		=20.000
13. factExpandConn	= 1.000
14. sigmaSmoothCurve	= 1.942 pixel
15. sigma		= 0.030
16. factSigmaThreshold	= 0.300
17. factSigmaThreStrict	= 2.000
18. zOcc		=10 plane
19. minNumPointsBr	=5
20. minLenBrIso		=20.000000 micron
21. somaSparseThr	=0.010000
22. factSigmaThresholdZ	= 1.000

Seldom changed parameters are:
23. maxFracTotPoints	= 0.500
24. zext		=6 plane
25. sigmaFilter		= 0.971 pixel
26. sigmaBack		=19.417 pixel
27. smallArea		=94 pixel^2
28. lambdaRatioThr	= 1.000
29. levelSetMu		= 0.100
30. factSearchMin	= 1.200
31. minRange		=19 pixel
32. minRadius		=2 pixel
33. maxRadius		=97 pixel
34. factShift		= 2.000
35. factAdjustRadius	= 1.000
36. factMarkOccXY	= 1.500
37. somaLengthScale	=19 pixel
38. alphaDistance	=20.000000
39. factSmallDerivZ	= 0.100
40. sigmaSmoothCurveZ	= 2.000 plane
Bright field image. 
Tracing neurons with filenameCommon = /content/granuleCell63XStart/granule-
Reading tile coordinates from /content/granuleCell63XStart/granule-.StitchCoord.txt 
Number of tiles = 4 tiff stack dimensions=(1040, 1388, 1)
Proc rank=0 Loading image from /content/granuleCell63XStart/granule-2.tif
Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Smoothing in each plane... Bright field image. normalize maximum intensity to 1...Creating mask....
thrSparse=0.002708 
In sparseFieldLevelset...Removing small areas ...
thrSpase=0.002708 points in skeleton=26116
Getting linked points...
tcmalloc: large alloc 1489715200 bytes == 0x563682798000 @  0x7ffbd0e941e7 0x5636218824ae 0x563621864ce3 0x7ffbd01e2b97 0x563621863eba
npoints=640
tcmalloc: large alloc 1489715200 bytes == 0x56368272a000 @  0x7ffbd0e941e7 0x5636218853f9 0x563621864d59 0x7ffbd01e2b97 0x563621863eba
No soma. sqrt(nn)=1 PARAMS.somaLengthScale=19
npoints=640
Deleting sharp turns (angle <60.000000 degrees) in xy ...
Growing from the end points...
tcmalloc: large alloc 1489715200 bytes == 0x56368272a000 @  0x7ffbd0e941e7 0x563621888c5d 0x563621864de2 0x7ffbd01e2b97 0x563621863eba
add 9 points...add 2 points...add 19 points...add 15 points...add 7 points...add 2 points...add 5 points...add 3 points...add 4 points...add 3 points...add 5 points...add 1 points...Reached max MAXREC, stop. add 20 points...Reached max MAXREC, stop. add 20 points...add 2 points...add 1 points...add 4 points...add 1 points...add 1 points...add 1 points...add 1 points...add 11 points...add 1 points...add 1 points...add 6 points...add 17 points...add 10 points...add 6 points...add 1 points...add 15 points...add 2 points...add 1 points...add 7 points...add 12 points...add 3 points...add 3 points...add 1 points...add 2 points...add 1 points...add 1 points...add 3 points...add 1 points...add 4 points...add 2 points...add 1 points...add 2 points...add 2 points...Reached max MAXREC, stop. add 20 points...add 11 points...add 12 points...add 4 points...add 2 points...add 1 points...add 1 points...add 7 points...add 3 points...Reached max MAXREC, stop. add 20 points...add 5 points...add 1 points...add 14 points...add 2 points...add 1 points...add 1 points...add 1 points...add 1 points...add 10 points...add 1 points...add 1 points...add 2 points...add 1 points...add 1 points...add 14 points...add 7 points...add 7 points...add 2 points...add 1 points...add 7 points...Reached max MAXREC, stop. Reached max MAXREC, stop. add 21 points...add 1 points...add 3 points...add 10 points...add 2 points...Reached max MAXREC, stop. Reached max MAXREC, stop. Reached max MAXREC, stop. add 22 points...add 1 points...add 1 points...add 1 points...add 13 points...Reached max MAXREC, stop. Reached max MAXREC, stop. add 21 points...add 2 points...add 4 points...add 2 points...add 15 points...add 3 points...add 10 points...re-do growth due to reaching recursion limit. add 11 points...add 6 points...add 8 points...add 3 points...Total points added: 563
rank=0 npoints=1176
Saving linked points to /content/granuleCell63XStart/granule-2.tif.linkedPoints.dat...
Proc rank=0 Loading image from /content/granuleCell63XStart/granule-3.tif
Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Smoothing in each plane... Bright field image. normalize maximum intensity to 1...Creating mask....
thrSparse=0.003168 
In sparseFieldLevelset...Removing small areas ...
thrSpase=0.003168 points in skeleton=21181
Getting linked points...
npoints=544
No soma. sqrt(nn)=1 PARAMS.somaLengthScale=19
npoints=544
Deleting sharp turns (angle <60.000000 degrees) in xy ...
Growing from the end points...
add 18 points...add 8 points...add 1 points...add 4 points...add 1 points...add 16 points...add 3 points...add 2 points...add 1 points...add 1 points...add 3 points...add 1 points...add 5 points...add 1 points...add 6 points...add 2 points...add 1 points...add 7 points...add 1 points...add 1 points...add 1 points...add 4 points...add 2 points...add 4 points...add 3 points...add 10 points...add 3 points...add 3 points...add 1 points...add 12 points...add 1 points...add 8 points...Reached max MAXREC, stop. Reached max MAXREC, stop. Reached max MAXREC, stop. Reached max MAXREC, stop. add 23 points...add 1 points...add 17 points...add 3 points...add 8 points...add 1 points...add 1 points...add 1 points...add 1 points...add 1 points...add 6 points...add 1 points...add 1 points...add 1 points...add 1 points...add 12 points...add 5 points...add 17 points...add 1 points...add 1 points...add 5 points...add 1 points...add 1 points...add 1 points...add 10 points...add 5 points...add 1 points...add 1 points...Reached max MAXREC, stop. Reached max MAXREC, stop. add 21 points...add 9 points...add 2 points...re-do growth due to reaching recursion limit. Total points added: 295
rank=0 npoints=812
Saving linked points to /content/granuleCell63XStart/granule-3.tif.linkedPoints.dat...
Proc rank=0 Loading image from /content/granuleCell63XStart/granule-4.tif
Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Smoothing in each plane... Bright field image. normalize maximum intensity to 1...Creating mask....
thrSparse=0.002787 
In sparseFieldLevelset...Removing small areas ...
thrSpase=0.002787 points in skeleton=33454
Getting linked points...
npoints=865
No soma. sqrt(nn)=7 PARAMS.somaLengthScale=19
npoints=865
Deleting sharp turns (angle <60.000000 degrees) in xy ...
Growing from the end points...
add 2 points...add 2 points...add 2 points...add 1 points...add 1 points...add 5 points...add 2 points...add 2 points...add 3 points...add 1 points...add 3 points...add 2 points...add 3 points...add 4 points...add 1 points...add 4 points...add 2 points...add 2 points...add 2 points...add 2 points...add 1 points...add 1 points...Reached max MAXREC, stop. add 20 points...add 3 points...add 2 points...add 1 points...add 6 points...add 9 points...add 1 points...add 7 points...add 1 points...add 2 points...add 2 points...add 3 points...add 1 points...add 2 points...add 3 points...add 1 points...add 3 points...add 2 points...add 1 points...add 3 points...add 9 points...add 1 points...add 2 points...add 5 points...add 2 points...add 15 points...add 2 points...add 15 points...add 1 points...add 1 points...add 1 points...add 1 points...add 1 points...add 1 points...add 1 points...add 1 points...add 1 points...add 5 points...add 1 points...add 4 points...add 1 points...add 1 points...add 1 points...add 1 points...add 1 points...add 3 points...add 1 points...add 3 points...add 1 points...add 1 points...add 1 points...add 3 points...add 1 points...add 1 points...add 1 points...add 1 points...add 2 points...add 3 points...add 6 points...add 4 points...add 13 points...add 11 points...add 2 points...add 2 points...add 3 points...add 2 points...Reached max MAXREC, stop. add 20 points...add 9 points...add 1 points...add 9 points...re-do growth due to reaching recursion limit. add 2 points...add 1 points...Total points added: 303
rank=0 npoints=1155
Saving linked points to /content/granuleCell63XStart/granule-4.tif.linkedPoints.dat...
Proc rank=0 Loading image from /content/granuleCell63XStart/granule-1.tif
Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Smoothing in each plane... Bright field image. normalize maximum intensity to 1...Creating mask....
thrSparse=0.002622 
In sparseFieldLevelset...Removing small areas ...
thrSpase=0.002622 points in skeleton=44366
Getting linked points...
npoints=993
added =10 soma points npoints=1003
Deleting sharp turns (angle <60.000000 degrees) in xy ...
Growing from the end points...
add 9 points...add 15 points...add 2 points...add 2 points...add 17 points...add 1 points...add 6 points...add 4 points...add 3 points...add 1 points...add 17 points...add 1 points...add 1 points...add 1 points...add 2 points...add 3 points...add 1 points...add 2 points...add 2 points...add 2 points...add 12 points...Reached max MAXREC, stop. Reached max MAXREC, stop. Reached max MAXREC, stop. Reached max MAXREC, stop. add 23 points...add 10 points...add 1 points...Reached max MAXREC, stop. Reached max MAXREC, stop. Reached max MAXREC, stop. add 22 points...add 12 points...add 2 points...add 2 points...add 1 points...add 2 points...add 3 points...add 16 points...add 19 points...add 3 points...add 9 points...add 4 points...Reached max MAXREC, stop. Reached max MAXREC, stop. Reached max MAXREC, stop. Reached max MAXREC, stop. add 23 points...add 5 points...add 2 points...add 2 points...add 1 points...add 4 points...add 1 points...add 2 points...add 3 points...add 2 points...add 2 points...add 1 points...add 2 points...add 4 points...add 5 points...add 3 points...add 2 points...add 4 points...add 1 points...add 9 points...add 1 points...add 1 points...add 8 points...add 2 points...add 1 points...add 2 points...add 2 points...add 2 points...add 1 points...Reached max MAXREC, stop. add 20 points...add 1 points...add 2 points...add 1 points...Reached max MAXREC, stop. add 20 points...Reached max MAXREC, stop. add 20 points...add 4 points...add 7 points...Reached max MAXREC, stop. add 20 points...add 2 points...Reached max MAXREC, stop. Reached max MAXREC, stop. add 21 points...add 5 points...Reached max MAXREC, stop. add 20 points...add 1 points...add 12 points...add 2 points...add 12 points...add 18 points...add 1 points...add 2 points...add 1 points...add 6 points...add 4 points...add 1 points...Reached max MAXREC, stop. add 20 points...add 5 points...add 3 points...add 1 points...add 1 points...add 1 points...add 4 points...add 2 points...add 3 points...add 3 points...add 5 points...add 2 points...add 1 points...add 1 points...add 2 points...add 3 points...add 2 points...add 6 points...add 2 points...add 2 points...add 4 points...add 3 points...add 2 points...add 5 points...re-do growth due to reaching recursion limit. add 2 points...add 9 points...add 7 points...Reached max MAXREC, stop. Reached max MAXREC, stop. add 21 points...Reached max MAXREC, stop. Reached max MAXREC, stop. Reached max MAXREC, stop. add 22 points...add 11 points...add 3 points...Reached max MAXREC, stop. Reached max MAXREC, stop. add 21 points...re-do growth due to reaching recursion limit. add 10 points...add 8 points...Total points added: 731
rank=0 npoints=1700
Saving linked points to /content/granuleCell63XStart/granule-1.tif.linkedPoints.dat...
Reading linked points from /content/granuleCell63XStart/granule-2.tif.linkedPoints.dat...npoints=1176 ns=11728
Reading linked points from /content/granuleCell63XStart/granule-3.tif.linkedPoints.dat...npoints=812 ns=8090
Reading linked points from /content/granuleCell63XStart/granule-4.tif.linkedPoints.dat...npoints=1155 ns=11492
Reading linked points from /content/granuleCell63XStart/granule-1.tif.linkedPoints.dat...npoints=1700 ns=16996
Rank=0 Total number of points=4843 linkedPSize=16996
Reading linked points from /content/granuleCell63XStart/granule-2.tif.linkedPoints.dat...
Image dimension=(1040 1388 129) type=0 number of channels=3
Reading linked points from /content/granuleCell63XStart/granule-3.tif.linkedPoints.dat...
Image dimension=(1040 1388 129) type=0 number of channels=3
Reading linked points from /content/granuleCell63XStart/granule-4.tif.linkedPoints.dat...
Image dimension=(1040 1388 129) type=0 number of channels=3
Reading linked points from /content/granuleCell63XStart/granule-1.tif.linkedPoints.dat...
Image dimension=(1040 1388 129) type=0 number of channels=3
Saving linked points to /content/granuleCell63XStart/granule-.linkedPoints.dat...
Growing from end points in each tile....
For growth, expand npoints by a factor 5 
Reading linked points from /content/granuleCell63XStart/granule-.linkedPoints.dat...
npointsTot=3108 ns=30964
Proc rank=0 Loading image from /content/granuleCell63XStart/granule-2.tif
Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Smoothing in each plane... Bright field image. normalize maximum intensity to 1...Deleting sharp turns (angle <60.000000 degrees) in xy ...
Growing from the end points...
add 6 points...add 5 points...add 1 points...Total points added: 12
Proc rank=0 created 12 points 
Saving linked points to /content/granuleCell63XStart/granule-.linkedPoints.dat...
Reading linked points from /content/granuleCell63XStart/granule-.linkedPoints.dat...
npointsTot=3105 ns=30994
Proc rank=0 Loading image from /content/granuleCell63XStart/granule-3.tif
Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Smoothing in each plane... Bright field image. normalize maximum intensity to 1...Deleting sharp turns (angle <60.000000 degrees) in xy ...
Growing from the end points...
add 1 points...add 2 points...add 6 points...add 4 points...add 5 points...add 1 points...add 2 points...add 1 points...add 1 points...add 1 points...add 13 points...Total points added: 37
Proc rank=0 created 37 points 
Saving linked points to /content/granuleCell63XStart/granule-.linkedPoints.dat...
Reading linked points from /content/granuleCell63XStart/granule-.linkedPoints.dat...
npointsTot=3141 ns=31390
Proc rank=0 Loading image from /content/granuleCell63XStart/granule-4.tif
Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Smoothing in each plane... Bright field image. normalize maximum intensity to 1...Deleting sharp turns (angle <60.000000 degrees) in xy ...
Growing from the end points...
add 2 points...add 1 points...add 4 points...add 1 points...add 3 points...Reached max MAXREC, stop. Reached max MAXREC, stop. Reached max MAXREC, stop. Reached max MAXREC, stop. add 23 points...add 1 points...re-do growth due to reaching recursion limit. Total points added: 35
Proc rank=0 created 35 points 
Saving linked points to /content/granuleCell63XStart/granule-.linkedPoints.dat...
Reading linked points from /content/granuleCell63XStart/granule-.linkedPoints.dat...
npointsTot=3176 ns=31762
Proc rank=0 Loading image from /content/granuleCell63XStart/granule-1.tif
Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Smoothing in each plane... Bright field image. normalize maximum intensity to 1...Deleting sharp turns (angle <60.000000 degrees) in xy ...
Growing from the end points...
add 2 points...add 1 points...add 1 points...add 1 points...add 4 points...add 2 points...add 2 points...Total points added: 13
Proc rank=0 created 13 points 
Saving linked points to /content/granuleCell63XStart/granule-.linkedPoints.dat...
Reading linked points from /content/granuleCell63XStart/granule-.linkedPoints.dat...
npointsTot=3189 ns=31906
Saving linked points to /content/granuleCell63XStart/granule-.linkedPoints.dat...
Reading linked points from /content/granuleCell63XStart/granule-.linkedPoints.dat...
npointsTot=3189 ns=31906
Saving linked points to /content/granuleCell63XStart/granule-.linkedPoints.dat...
Reading linked points from /content/granuleCell63XStart/granule-.linkedPoints.dat...
npointsTot=3189 ns=31906
For connecting ends, making searchMax and distFactor by a factor of 1.000000
Proc rank=0 Loading image from /content/granuleCell63XStart/granule-2.tif
Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Smoothing in each plane... Bright field image. normalize maximum intensity to 1...Connecting ends...
Proc rank=0 made 86 connections
Proc rank=0 Loading image from /content/granuleCell63XStart/granule-3.tif
Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Smoothing in each plane... Bright field image. normalize maximum intensity to 1...Connecting ends...
Proc rank=0 made 34 connections
Proc rank=0 Loading image from /content/granuleCell63XStart/granule-4.tif
Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Smoothing in each plane... Bright field image. normalize maximum intensity to 1...Connecting ends...
Proc rank=0 made 66 connections
Proc rank=0 Loading image from /content/granuleCell63XStart/granule-1.tif
Image dimension=(1040 1388 129) type=0 number of channels=3
Color stack. Smoothing in each plane... Bright field image. normalize maximum intensity to 1...Connecting ends...
Proc rank=0 made 92 connections
Saving linked points to /content/granuleCell63XStart/granule-.linkedPoints.dat...
Reading linked points from /content/granuleCell63XStart/granule-.linkedPoints.dat...
npointsTot=3189 ns=32184
Creating swc file...
Deleting small branches of length 1...Deleting connections to the deleted points...Deleting points...Deleted 125 points. npoints=3064 
Deleting small branches of length 2...Deleting connections to the deleted points...Deleting points...Deleted 36 points. npoints=3028 
Deleting small branches of length 3...Deleting connections to the deleted points...Deleting points...Deleted 21 points. npoints=3007 
Deleting small branches of length 4...Deleting connections to the deleted points...Deleting points...Deleted 22 points. npoints=2985 
Deleting small branches of length 5...Deleting connections to the deleted points...Deleting points...Deleted 11 points. npoints=2974 
Removing connected points if the total length is smaller than 20.000000 micron...Deleted 223 noisy points.
Delete isolated branches with length smaller than 20.000000 and leaf branch smaller than 5
Saving SWC to /content/granuleCell63XStart/granule-.auto.swc
There 48 segments 4 trees

The above cell should eventually end in:

Creating swc file...
Deleting small branches of length 1...Deleting connections to the deleted points...Deleting points...Deleted 125 points. npoints=3064 
Deleting small branches of length 2...Deleting connections to the deleted points...Deleting points...Deleted 36 points. npoints=3028 
Deleting small branches of length 3...Deleting connections to the deleted points...Deleting points...Deleted 21 points. npoints=3007 
Deleting small branches of length 4...Deleting connections to the deleted points...Deleting points...Deleted 22 points. npoints=2985 
Deleting small branches of length 5...Deleting connections to the deleted points...Deleting points...Deleted 11 points. npoints=2974 
Removing connected points if the total length is smaller than 20.000000 micron...Deleted 223 noisy points.
Delete isolated branches with length smaller than 20.000000 and leaf branch smaller than 5
Saving SWC to /content/granuleCell63XStart/granule-.auto.swc
There 48 segments 4 trees

Test probe of file system

!pwd
!ls -l
!echo ------------
!ls /content/granuleCell63XStart/granule*
/content
total 1645644
-rw-r--r-- 1 root root 1389488667 Oct 14 00:28 f4gs13fs0y9ckrjjo78oid7hkv61k2wq.zip
drwxrwxr-x 3 root root       4096 Oct 14 01:10 granuleCell63XStart
drwxr-xr-x 1 root root       4096 Aug 27 16:17 sample_data
drwxrwxr-x 5 root root       4096 Oct 14 00:40 ShuTuUbuntu
-rw-r--r-- 1 root root  295628950 Oct 14 00:39 wszpq3r6hwgoxo8eq0vb1k82fwrabycl.zip
------------
/content/granuleCell63XStart/granule-1.Proj.tif
/content/granuleCell63XStart/granule-1.tif
/content/granuleCell63XStart/granule-1.tif.linkedPoints.dat
/content/granuleCell63XStart/granule-2.Proj.tif
/content/granuleCell63XStart/granule-2.tif
/content/granuleCell63XStart/granule-2.tif.linkedPoints.dat
/content/granuleCell63XStart/granule-3.Proj.tif
/content/granuleCell63XStart/granule-3.tif
/content/granuleCell63XStart/granule-3.tif.linkedPoints.dat
/content/granuleCell63XStart/granule-4.Proj.tif
/content/granuleCell63XStart/granule-4.tif
/content/granuleCell63XStart/granule-4.tif.linkedPoints.dat
/content/granuleCell63XStart/granule-.auto.swc
/content/granuleCell63XStart/granule-.flatCombined.tif
/content/granuleCell63XStart/granule-.linkedPoints.dat
/content/granuleCell63XStart/granule-.StitchCoord.txt
/content/granuleCell63XStart/granule-.tiles.json
# Optionally, download that newly created SWC before it gets thrown away after a max of 12 hours.
from google.colab import files
files.download('/content/granuleCell63XStart/granule-.auto.swc')