API
nd2read.jl
ND2Process.nd2dim — Function.nd2dim(path_nd2)Returns dim of the file in (x, y, z, t, c)
Arguments
path_nd2: .nd2 file to readverbose: if true, print out the dimensions
ND2Process.nd2read — Function.nd2read(path_nd2; ch=1, t=1)Read the image at ch and t
Arguments
path_nd2: .nd2 file to readch: ch to read. First ch: 1t: time point to read. Can be multiple. First t: 1
ND2Process.nd2preview — Function.nd2preview(path_nd2; ch=1, return_data=false, z_crop=nothing)Preview MIP of first, middle, and last time points in the .nd2 file
Arguments
path_nd2: .nd2 file to readch: ch to use. Default: 1 (first ch)return_data: if true returns the 3 images as arrayz_crop: selecting z range to use. e.g.3:15then only use slice 3 to 15
ND2Process.nd2preview_crop — Function.nd2preview_crop(stack::Array; θ, x_crop=nothing, y_crop=nothing,
z_crop=nothing)Preview MIP of rotatation and x, y, z cropping
Arguments
stack: array (e.g. returned fromnd2previewwithreturn_data=true)
containing 3 stacks
θ: yaw angle (lateral rotation)x_crop: range of x to usey_crop: range of y to usez_crop: range of z to use
nd2convert.jl
ND2Process.nd2_to_mhd — Function.nd2_to_mhd(path_nd2, path_save,
spacing_lat, spacing_axi, generate_MIP::Bool;
θ=nothing, x_crop::Union{Nothing, UnitRange{Int64}}=nothing,
y_crop::Union{Nothing, UnitRange{Int64}}=nothing,
z_crop::Union{Nothing, UnitRange{Int64}}=nothing, chs::Array{Int}=[1],
MHD_dir_name="MHD", MIP_dir_name="MIP")Saves nd2 into MHD files after rotating and cropping. Rotation is skipped if θ is set to nothing.
Arguments
path_nd2: path of .nd2 file to usepath_save: path of .h5 file to savespacing_lat: lateral spacing (for logging)spacing_axi: axial spacing (for logging)generate_MIP: if true, save MIP in as previewθ: yaw angle (lateral rotation, radian). nothing if no rotationx_crop: x range to use. Full range if nothingy_crop: y range to use. Full range if nothingz_crop: z range to use. Full range if nothingchs: ch to useMHD_dir_name: name of the subfolder to save MHD filesMIP_dir_name: name of the subfolder to save MIP files
ND2Process.nd2_to_h5 — Function.nd2_to_h5(path_nd2, path_save, spacing_lat, spacing_axi; θ=nothing,
x_crop::Union{Nothing, UnitRange{Int64}}=nothing,
y_crop::Union{Nothing, UnitRange{Int64}}=nothing,
z_crop::Union{Nothing, UnitRange{Int64}}=nothing, chs::Array{Int}=[1])Saves nd2 into HDF5 file after rotating and cropping. Rotation is skipped if θ is set to nothing. Note: indexing is 1 based. Array axis is in the following order: [x, y, z, t, c]. HDF5 file is chunked with: (x size, y size, z size, 1, 1, 1)
Arguments
path_nd2: path of .nd2 file to usepath_save: path of .h5 file to savespacing_lat: lateral spacing (for logging)spacing_axi: axial spacing (for logging)θ: yaw angle (lateral rotation, rauab). nothing if no rotationx_crop: x range to use. Full range if nothingy_crop: y range to use. Full range if nothingz_crop: z range to use. Full range if nothingchs: ch to use