--------------------------------------------------- Requirements Windows 64-bit (7 or newer, tested with Windows 7, 8.1, and 10) 8 GB of RAM or more 20 GB or more of free hard drive space ImageJ (latest version, tested with) - https://fiji.sc BigStitcher (latest version) - https://imagej.net/BigStitcher Python (2.7.xx, tested with 2.7.15) - https://www.python.org/downloads HDF5 (1.8.xx, tested with 1.8.20) - https://www.hdfgroup.org/solutions/hdf5 B3D (latest version) - https://git.embl.de/balazs/B3D DCAM API (latest version) - https://dcam-api.com/downloads CUDA capable graphics card (minimum compute capability 3.0, tested with TitanXP, QuadroP6000, and GTX1080) CUDA 8 compatible graphics driver (GeForce 378.66 or newer) - https://developer.nvidia.com/cuda-downloads --------------------------------------------------- Installation Instructions 1. Download the latest version of ImageJ from https://fiji.sc/ 2. Install ImageJ BigStitcher plugin (help -> update -> manage update sites -> BigStitcher) 3. Install ImageJ HDF5 plugin (help -> update -> manage update sites -> HDF5) Click Close. Click Apply changes. 4. Install HDF5 1.8.20 from https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-1.8.20/bin/windows/hdf5-1.8.20-Std-win7_64-vs14.zip (Note: do not install versions 1.10.xx as B3D is only compatible with 1.8.xx) 5. Install B3D from https://git.embl.de/balazs/B3D After downloading the repository, open a terminal in the B3D directory. Open a command prompt in the downloaded B3D/win64 directory. Issue the command: >> install_b3d.bat 6. ImageJ comes with its own distribution of HDF5 in the form of jhdf5-14.12.5.jar in the Fiji.app/jars folder. On Windows machines this is not compatible with B3D because a different version of Visual Studio was used to compile the native libraries. To circumvent this issue, B3D provides a recompiled version of the same file, included in the win64 folder. Copy this file to ImageJ jars folder and delete the already existing version jhdf5-14.12.6.jar. 7. Install Python 2.7 from https://www.anaconda.com/distribution (Note: do not install versions 3.x as this code is only compatible with versions 2.x) Make note of where you install Anaconda. Confirm that the installed 2.7 version of Python is the version associated when the command "python" is executed from a command prompt. If it is not, navigate to your environment variables (control panel -> search -> environment variables -> edit). Inspect the PATH environment variable for the local user and system. Remove any other Python paths that are not the recently installed Anaconda path. In the event that the Anaconda path was not automatically added to the PATH varible, manually enter it into the PATH variable. The PATH variable should also include a path to the scripts folder of the Anaconda installation (so the command "conda" will be recognized). By default, these two paths should be: C:\ProgramData\Anaconda2 C:\ProgramData\Anaconda2\Scripts 8. Install required Python packages and tested versions: hdf5 (1.8.15.1), scipy (1.1.0), tqdm (4.26.0), h5py (2.7.0). (Note for compatibility with B3D within python, install the older listed versions of hdf5 and h5py for Python 2.7.xx.) Install through Anaconda with these commands: >> conda install hdf5=1.8.15.1 >> conda install h5py=2.7.0 >> conda install scipy=1.1.0 >> conda install tqdm=4.26.0 Alternatively, pip (https://pypi.org/project/pip) can be used to install packages if Python was not installed using Anaconda. 9. Install DCAM API from https://dcam-api.com/downloads During installation, install the Active Silicon FireBird/Phoenix DCAM API. This will install necessary libraries which are called by the included DCIMG.dll file. 10. Download the example data from FigShare: https://figshare.com/articles/Supplementary_Data/7685597 *The entire installation time for all packages should take 1-2 hours on a normal desktop computer. --------------------------------------------------- Usage Instructions 1. To test the installed programs and process the example data, the dcimg_hdf5.py and bdv_xml.py files must be called using Python. dcimg_hdf5.py Inputs: filename: path and name of DCIMG file dir: shearing direction (0 or 1). for this data should be set to 0. idx: index for imaging tile (0 ... # of tiles). binFactor: imaging data binning factor (1, 2, 4, 8). for this data should be set to 1. Outputs: data.h5: this file will be in the same directory as the input data bdv_xml.py Inputs: channels: number of color channels tiles: number of imaging tiles in each color channel. Outputs: data.xml: this file will be in the same directory as the bdv_xml.py file For the example data, place dcimg_hdf5.py, bdv_xml.py, and DCIMG.dll in the same directory as the example data. Open a command prompt in this directory. Execute these commands: >> del /f data.h5 >> del /f data.xml >> python dcimg_hdf5.py 000001.dcimg --dir=0 --idx=0 --binFactor=1 >> python dcimg_hdf5.py 000002.dcimg --dir=0 --idx=1 --binFactor=1 >> python dcimg_hdf5.py 000003.dcimg --dir=0 --idx=2 --binFactor=1 >> python dcimg_hdf5.py 000004.dcimg --dir=0 --idx=3 --binFactor=1 >> python bdv_xml.py --channels=1 --tiles=4 2. At the end of this batch processing routine, there should be the output files data.xml and data.h5 in the directory. Correctly generated versions of data.xml and data.h5 are included as data_ref.xml and data_ref.h5. These can be opened and subsequently processed using ImageJ / BigStitcher. The output files should be 7-10x smaller than the input data because of B3D compression. *The entire processing time for the example data should take <<30 minutes on a normal desktop computer. --------------------------------------------------- BigStitcher Instructions 1. Open ImageJ and open BigStitcher (plugins -> BigStitcher -> BigStitcher) 2. Select the data.xml file and click OK. 3. This should open the Stitching Explorer and BigDataViewer window. 4. Highlight all of the rows in the Stitching Explorer, right-click -> Arrange Views -> Move Tiles to Regular Grid... 5. Set X=1, Y=1, Z=4. Uncheck the link box. Set the Z overlap % to 14 (slightly higher than the actual overlap, to provide enough room for accurate alignment). 6. Click Apply Transformations. 7. Right-click -> Stitch dataset... 8. Set Downsample in X, Y, and Z to 4. Click OK. 9. When stitching finishes, Click Yes. Click Apply & Run Global Optimization. Click OK (Identify wrong links and handle unconnected tiles, STRICT) *The entire stitching time for the example data should take <<5 minutes on a normal desktop computer. 10. The data is now aligned properly. To fuse it to disk, right-click -> Image Fusion ... 11. Set the settings to: Downsampling = 1 Pixel type = 16-bit Interpolation = linear Image = Precompute Blend images smoothly = Yes Use content based fusion = No Produce one fused image for = Each timepoint & channel Fused image = Save as new XML Project (HDF5) 12. Leave all defaults on the following screen and click OK. *The entire fusion time for the example data should take <30 minutes on a normal desktop computer. 13. After the image fusion completes, there should be a new data-f0.xml and data-f0.h5 file in the directory. 14. This fused 3D dataset can be opened using ImageJ -> plugins -> BigDataViewer -> Open XML/HDF5. Select the data-f0.xml file. Click OK. ---------------------------------------------------