Giter Club home page Giter Club logo

tsipkens / atems Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 8.0 236.25 MB

A MATLAB codebase to analyze TEM images of soot, which includes new methods associated with this project and a compilation of other pre-existing methods into a single package.

License: GNU General Public License v3.0

MATLAB 97.15% Python 2.75% Shell 0.10%
soot aggregates transmission-electron-microscopy particle-size-distribution tem tem-images particle-diameter aerosols image-processing

atems's People

Contributors

leumasd10 avatar tsipkens avatar utrivanovic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

atems's Issues

Normalization in PCM differs from original code

Description
The current PCM function has an output that differs subtly from the original implementation of Dastanpour et al.

To Reproduce
Direct reproduction is challenging, as the original code had different inputs and involved user intervention. Bug was found by inspection of pair correlation function (PCF) curves and the underlying code.

Expected behavior
The code should have the ability to reproduce previous version of the PCM method.

Other suggested changes
Consider adding versioning, to allow for current version, past version, and future versions, which may improve interpretation of the PCF curve. This can also be used to encode the simple and advanced versions of the existing PCM output, simplifying output to a single primary particle size depending on the specified version.

Example code does not run

atems/README.md

Line 118 in 0e24b57

imgs_binary = agg.seg_kmeans(imgs, pixsizes, opts);

This example won't run as written, because the opts variable isn't yet defined.

If a user just copies the text and pastes into Matlab, it won't work.

Fails with a Matlab error

function [t2,t0] = write_json(var, fname)

When I run tools.write_json(Aggs, 'test.json');. Fails with

Error using jsonencode
Unable to encode objects of class logical as JSON-formatted text.
Error in tools.write_json (line 9)
t0 = jsonencode(var); % generate json text using built-in function

I think this is a Matlab version incompatibility. Here is my Matlab version info:

MATLAB Version: 9.14.0.2254940 (R2023a) Update 2
Operating System: macOS Version: 12.6.9 Build: 21G726
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode

Matlab crashes

Several of the main_* functions will occasionally lock up Matlab on my computer. main_kmeans and the final section of main_0 after agg.analyze_binary. I can step through each function line-by-line, so it's not clear where the problem is.

Here is my Matlab and operating system information:

MATLAB Version: 9.14.0.2254940 (R2023a) Update 2
Operating System: macOS Version: 12.6.9 Build: 21G726
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode

Mistake in function name

atems/README.md

Line 237 in cd661f0

### + **seg_otsu_rb\*** / Otsu thresholding

These lines refer to agg.seg_otsu_rb_orig(...) and agg.seg_otsu_rb(...). There aren't these functions in the agg directory. I think these should be agg.seg_otsu_orig(...) and agg.seg_otsu(...).

Example code does not run

atems/README.md

Line 127 in 0e24b57

Aggs = agg.analyze_binary(...

This example code won't run as written, because fname is not yet defined. What is the structure of fname?

I was able to run this command:

Aggs = agg.analyze_binary(imgs_binary, pixsizes, imgs)

Based on the help in agg.analyze_binary, it looks like agg.analyze_binary(images_binary, Imgs), where Imgs is the structure output from tools.load_images should work, and should then include the file name, but I get an error:

Operator '*' is not supported for operands of type 'struct'.
Error in agg.analyze_binary (line 198)
Aggs0(jj).length = max((max(row)-min(row)), (max(col)-min(col))) * pixsize(ii);

Suggestions for greater usability

atems/main_0.m

Line 16 in cd661f0

imgs_binary = agg.seg(imgs, pixsizes, opts);

  • Change "more particles or add to existing particles" button to be labeled something like "Interactive tool to adjust thresholding"
    • Adjusting the "slider" does not seem to offer any feedback on how it is changing the threshold. That makes it very hard to judge whether the change is sufficient. I suggest overlying a color that shows the thresholded region.
    • I'm not sure if I'm doing it incorrectly, but every time I adjust the slider, I get a black image afterward, suggesting that the threshold is incorrect
    • There does not seem to be a way to go back in the steps. That would be helpful
    • Now I see that "Add (to) aggregates" button is sort of like a "start over" option. It is unclear what that actually does

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.