Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
de438e8
add list of images; id that tracks selected image
May 28, 2025
ad1401e
formatting
May 28, 2025
3b8486d
add new imgs to ref; switch between with topbar
May 28, 2025
a2525e4
got multi drag drop working
May 28, 2025
122d8e1
send multiple files from frontend
May 29, 2025
52956f0
recieve multiple files in server; explictly check if supplied stack i…
May 29, 2025
94b88d6
force float for typechecker
May 29, 2025
e5adf02
put phase fracs into image load info, calc on load
May 29, 2025
063053c
start threading all image info to results components
May 29, 2025
9d5d8e0
conditionally render img batch
May 29, 2025
3256ff6
fix results to use new phase fracs
May 30, 2025
2bfdfae
better logging
May 30, 2025
9a88efc
remove unused accurateFractions state
May 30, 2025
e64872f
remove many unused imports
May 30, 2025
c587c56
abstract getting N ims from dim into own function; reuse
May 30, 2025
416bd68
show congratualtions correctly
May 30, 2025
0ac5d25
WIP grid layout vis
May 30, 2025
e3975f6
sort unique values properly
May 30, 2025
85b0abe
started working on new multi canvas display: add new preview image wh…
May 30, 2025
e83275c
req phase frac after display
May 30, 2025
23ba023
animate to measure squares; add back in 3D vis
May 30, 2025
7eab5f7
remove old preview canv code
May 30, 2025
1d09347
add asyncs to server def so easier to deploy
May 30, 2025
09f2217
fix async defs; add as req
May 30, 2025
cd9105a
Merge pull request #64 from tldr-group/updated-img-size-vis
rmdocherty Jul 29, 2025
173b0b2
add paper details
Jul 29, 2025
d5126f9
add paper details
Jul 29, 2025
e1ff073
fix reset: reset n imgs and allImageInfos
Jul 29, 2025
937a490
Merge pull request #65 from tldr-group/minor-fixes
rmdocherty Jul 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ authors:
- name: Samuel J. Cooper
orcid: 0000-0003-4055-6903
title: "Prediction of Microstructural Representativity from a Single Image"
doi: arXiv:2410.19568v1
url: "https://arxiv.org/abs/2410.19568v1"
doi: https://doi.org/10.1002/advs.202414149
url: "https://advanced.onlinelibrary.wiley.com/doi/10.1002/advs.202414149"
preferred-citation:
type: article
authors:
- name: Amir Dahari
orcid: 0000-0003-0142-8597
- name: Ronan Docherty
orcid: 0000-0002-7332-0924
- name: Steve Kench
orcid: 0000-0002-7263-6724
- name: Samuel J. Cooper
orcid: 0000-0003-4055-6903
doi: arXiv:2410.19568v1
journal: "arXiV preprint"
month: 8
- name: Amir Dahari
orcid: 0000-0003-0142-8597
- name: Ronan Docherty
orcid: 0000-0002-7332-0924
- name: Steve Kench
orcid: 0000-0002-7263-6724
- name: Samuel J. Cooper
orcid: 0000-0003-4055-6903
doi: https://doi.org/10.1002/advs.202414149
journal: "Advanced Science"
month: 7
title: "Prediction of Microstructural Representativity from a Single Image"
year: 2024
year: 2025
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[Try it out!](https://www.imagerep.io/)

Here we introduce the 'ImageRep' method for fast phase fraction representativity estimation from a single microstructural image. This is achieved by calculating the Two-Point Correlation (TPC) function of the image, combined with a data-driven analysis of the [MicroLib](https://microlib.io/) dataset. By applying a statistical framework that utilizes both data sources, we can establish the uncertainty in the phase fraction in the image with a given confidence, **and** the image size that would be needed to meet a given target uncertainty. Further details are provided in our [preprint](https://arxiv.org/abs/2410.19568).
Here we introduce the 'ImageRep' method for fast phase fraction representativity estimation from a single microstructural image. This is achieved by calculating the Two-Point Correlation (TPC) function of the image, combined with a data-driven analysis of the [MicroLib](https://microlib.io/) dataset. By applying a statistical framework that utilizes both data sources, we can establish the uncertainty in the phase fraction in the image with a given confidence, **and** the image size that would be needed to meet a given target uncertainty. Further details are provided in our [paper](https://advanced.onlinelibrary.wiley.com/doi/10.1002/advs.202414149).

If you use this ImageRep in your research, [please cite us](CITATION.cff).

Expand All @@ -17,10 +17,11 @@ This method can be used via the [website (imagerep.io)](https://www.imagerep.io/
NB: the website may run out of memory for large volumes (>1000x1000x1000) - if this happens run the method locally or contact us

## Limitations:
- **This is not the only source of uncertainty!** Other sources *i.e,* segmentation uncertainty, also contribute and may be larger
- For multi-phase materials, this method estimates the uncertainty in phase-fraction of a single (chosen) phase, counting all the others as a single phase (*i.e,* a binary microstructure)

- **This is not the only source of uncertainty!** Other sources _i.e,_ segmentation uncertainty, also contribute and may be larger
- For multi-phase materials, this method estimates the uncertainty in phase-fraction of a single (chosen) phase, counting all the others as a single phase (_i.e,_ a binary microstructure)
- Not validated for for images smaller than 200x200 or 200x200x200
- Not validated for large integral ranges/features sizes (>70 px)
- Not validated for large integral ranges/features sizes (>70 px)
- Not designed for periodic structures
- 'Length needed for target uncertainty' is an intentionally conservative estimate - retry when you have measured the larger sample to see a more accurate estimate of that uncertainty

Expand All @@ -31,11 +32,11 @@ These instructions are for installing and running the method locally. They assum
### Preliminaries

Install [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) (ideally via a manager like [nvm](https://github.com/nvm-sh/nvm)) if you want to run the website. Clone this repo and change directory:

```
git clone https://github.com/tldr-group/Representativity && cd Representativity
```


### Install & run the backend

0. Setup a [virtual environment in Python](https://docs.python.org/3/library/venv.html) and activate it (not necessary but recommended)
Expand All @@ -55,13 +56,12 @@ python -m flask --app server run

The server should now be running on `http://127.0.0.1:500` and listening for requests!


3. If you want to reproduce (all) the figures, you'll need `pytorch` and some additional dependencies. It may be worth using [conda](https://www.anaconda.com/) to install `pytorch` as this will interact correctly with your GPU. Run

```
pip install -r requirements_dev.txt
```


### Install & run the frontend

0. Install the JS libraries needed to build and run the frontend. Install Yarn (and npm first if needed)
Expand All @@ -86,4 +86,4 @@ yarn && yarn start

```
python tests/tests.py
```
```
4 changes: 4 additions & 0 deletions frontend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"tabWidth": 2,
"useTabs": false
}
10 changes: 5 additions & 5 deletions frontend/configs/webpack/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,19 @@ module.exports = {
{
from: "src/assets",
to: "assets",
}
]
},
],
}),
new HtmlWebpackPlugin({
template: "./src/assets/index.html",
favicon: "./src/assets/favicon.png"
favicon: "./src/assets/favicon.png",
}),
new FriendlyErrorsWebpackPlugin(),
new webpack.ProvidePlugin({
process: "process/browser",
}),
],
experiments: {
topLevelAwait: true
}
topLevelAwait: true,
},
};
4 changes: 2 additions & 2 deletions frontend/configs/webpack/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ module.exports = merge(commonConfig, {
open: true,
historyApiFallback: true,
// These headers enable the cross origin isolation state
// needed to enable use of SharedArrayBuffer for ONNX
// multithreading.
// needed to enable use of SharedArrayBuffer for ONNX
// multithreading.
headers: {
"Cross-Origin-Opener-Policy": "same-origin",
"Cross-Origin-Embedder-Policy": "credentialless",
Expand Down
5 changes: 3 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"lint": "eslint './src/**/*.{js,ts,tsx}' --quiet",
"start": "yarn run start-dev",
"test": "yarn run start-model-test",
"start-dev": "webpack serve --config=configs/webpack/dev.js"
"start-dev": "webpack serve --config=configs/webpack/dev.js",
"pretty": "prettier --write \"./**/*.{js,jsx,mjs,cjs,ts,tsx,json}\""
},
"devDependencies": {
"@babel/core": "^7.18.13",
Expand Down Expand Up @@ -65,4 +66,4 @@
"@types/react-dom": "18.2.0",
"@types/react": "18.2.0"
}
}
}
2 changes: 1 addition & 1 deletion frontend/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const tailwindcss = require("tailwindcss");
module.exports = {
plugins: ["postcss-preset-env", 'tailwindcss/nesting', tailwindcss],
plugins: ["postcss-preset-env", "tailwindcss/nesting", tailwindcss],
};
Loading