Giter Site home page Giter Site logo

nppc-uk / microct_grain_analyser Goto Github PK

View Code? Open in Web Editor NEW
7.0 4.0 0.0 604 KB

Software for processing output of Scanco uCT machines/ any ISQ or TIF producing machine, and producing data. See instructions.pdf for full explaination.

License: Other

MATLAB 99.35% Shell 0.65%
3d image-processing biology ct-scans micro-ct bioinformatics plants

microct_grain_analyser's Introduction

Usage Instructions for Micro-CT Plant Images

Releases

This software works as a iteration-based release, adding new features and optimising and as such please refer to releases for the latest stable version.

Usage

Usage of this software is straightforward. Inputting a directory, a voxel size and a minimum size of expected grain objects will output and write grain statistics and image to file.

Setup variables

A brief setup of environment variables are required, this is an example:

voxelSize = 68.8; % or whatever micro-meter to voxel ratio was used in scanning
minimumGrainSize = 10000; % a minimum grain size of interest
structEleSize = 5; % a size of structuring element to use for morphological operations

% Every folder in CT-Scans folder and every ISQ file in them
directory = '/home/files/CT-Scans/*.ISQ';

% More optional parameters which change type of scanning
startFrom = 1;
endAt = 0;
watershed = true;

Optional Parameters

  • startFrom indicates file to start at from the directory indicated, almost always use ‘1’. It’s useful for if processing fails partway through
  • endAt is where the process will stop, useful for if you’d only like to use a few scans for testing. Default is 0 and this will process everything
  • watershed will be a boolean value which will toggle if the more robust and strict watersheding is triggered - this will make processing take a lot longer and at times may over-segment. Generally only use if scans are failing to separate properly, or are particularly small (i.e. wild types / barley)

N.B.

Scanco has been known to alter the filenames for a reason known only Minerva would know. So be on the lookout for:

C0000123.ISQ;1

To get around this I recommend running a script something like this (or a sed equivalent):

from glob import glob
from os import rename
[rename(f, f.replace(';','')) for f in glob('*.ISQ;1')]

Running

Running the program is as simple as calling the processDirectory function.

% Will process all files found by rdir function
processDirectory(directory, structEleSize, voxelSize, minimumGrainSize);

Files and Functions

cleanWheat

cleanWheat is a function which takes as input a filename location on disk of an ISQ raw image, it processes it and outputs a binary 3D image and a greyscale 3D image which has been cleaned and segmented.

countGrain

countGrain takes cleaned image data, separates each identified grain and computes statistics on a grain-per-grain basis. It returns two statistics objects, one with raw pixel data counted and another with computed metric values.

filterSmallObjects

filterSmallObjects attempts to remove all objects which are smaller than the specified parameter during setup. This uses pixel size not metric sizes for this.

imSurface

imSurface is a library originally by David Legland. It measures the surface area in pixels of a 3D object.

processDirectory

processDirectory is the main controlling function of this software, it moves image data around from function to function, gathers image results/measurements and saves it to disk from here.

subdir

subdir is a function which recursively finds files, it is used to find files in sub-directories by using the ‘*’ wildcard in the directory name parameter.

  • This function was redone as the previous ‘rdir’ has operating issues with certain versions of windows.

readISQ

readISQ originally developed by Johan Karlsson, we have modified it to make speed increases and added specific slice loading, this helps for increased speed when processing larger images

segmentRachis

segmentRachis finds locations of nodes along the rachis of spikes of wheat, oats etc. Use of this data is primarily for locating joining points of split scans.

watershed3D

watershed3D incorporates traditional watershedding techniques and has adapted them to work in 3D. It also makes use of modernised distance-based watershed methods, by way of chessboard distance technique.

writeTif

writeTif writes image stacks to disk as TIF formatted files.

Output

From successful running of this software output will be:

  • A statistics of grains CSV with metric values
  • A statistics of grains CSV with raw values
  • A TIF file of the segmented image
  • A statistics file of the rachis top and bottom points.
  • A folder of 2D cross sectional images, for each grain
  • A folder of 3D TIF files, each a individual grain

The output folder should look similar to this:

./directory.png

microct_grain_analyser's People

Contributors

maxf130 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

microct_grain_analyser's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.