Skip to content

Commit b77cf8a

Browse files
committed
v2.7.0
1 parent 7366c6b commit b77cf8a

File tree

170 files changed

+5607
-2924
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+5607
-2924
lines changed

.dockerignore

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
1+
# Allow
2+
!**/requirements.txt
3+
!**/pyproject.toml
4+
!**/setup.py
5+
6+
7+
# Ignore
18
env
29
.env
3-
src/modules
4-
src/submodules
10+
.git
11+
12+
# Large files
13+
**/*.nrrd
14+
**/*.tsv
15+
**/*.vtk
16+
17+
# Images
18+
**/*.svg
19+
**/*.jpg
20+
**/*.jpeg
21+
**/*.png
22+
23+
# Specific directories
24+
src/modules/*/Test?
25+
src/modules/**/Resources
526
src/ltrace/build
627
src/ltrace/ltrace/assets
7-
.git
828
tools/deploy/GeoSlicerManual
929
tools/deploy/Resources
10-
gs*/*
30+
gs*/*

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,6 @@ TODO.md
160160

161161
# Streamlit data files
162162
src/modules/MicrotomRemote/PNM_Report/static/
163+
164+
# Release application file (downloaded to build Azure VM Offer Image)
165+
/tools/packer/resources/geoslicer-*.tar.gz

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,22 @@
1212

1313
# GeoSlicer
1414

15-
GeoSlicer is a software platform for digital rock visualization and image processing, encompassing multiple approaches involving thin section, CT and mCT imagery. We use advanced techniques, like Convolution Neural Networks, to deliver a unique solution that allows users to solve complex workflows from a single platform.
15+
GeoSlicer is a software platform for digital rock visualization and image processing, encompassing multiple approaches involving thin section, CT and mCT imagery. We use advanced techniques, like Convolution Neural Networks, to deliver a unique solution that allows users to solve complex workflows from a single platform. Please find the latest public release on the GitHub [releases page](https://github.com/petrobras/GeoSlicer/releases).
16+
17+
## Portable mode
18+
19+
The application is released as portable, which means the user unpacks the compressed file and it is ready to use, there is no need to install it. The application also needs to write files and folders inside the subfolder **LTrace** inside the unpacked folder, hence the user needs write permission on the unpacked folder.
1620

1721
## Use cases and examples
1822

1923
Users can find examples of GeoSlicer uses in the following video and at [LTrace's Youtube channel](https://www.youtube.com/@ltracegeo).
2024

21-
[![Watch te video](https://img.youtube.com/vi/EPKBOYkJE40/0.jpg)](https://www.youtube.com/watch?v=EPKBOYkJE40)
25+
[![Watch te video](https://img.youtube.com/vi/EPKBOYkJE40/0.jpg)](https://www.youtube.com/watch?v=_FkbP9fqBJQ)
2226

2327
## Developer intro
2428

2529
The GeoSlicer code is a set of modules and auxiliary functions to work with digital rock images. The modules are installed onto a modified version of [3D Slicer](https://github.com/Slicer/Slicer) which we call GeoSlicer-base. To do so, a deploy script is used to deploy and install modules, generate a release, install in development mode, generate the public and opensource versions and commit them to the open source repository.
26-
GeoSlicer-base can be obtained from pre-built binaries available for [windows](https://objectstorage.sa-saopaulo-1.oraclecloud.com/p/9YamKS-nDFknDBbJ_J3Dr8bgiUxfRDVnI5VhGXJpp81l1DUOCMPTZ58H0qHa056V/n/grrjnyzvhu1t/b/General_ltrace_files/o/GeoSlicer/base/release/win32/GeoSlicer-2.2.2-2024-04-01-win-amd64.zip) and [linux](https://objectstorage.sa-saopaulo-1.oraclecloud.com/p/ODrLP5ha4lH7usFggSHCVUbRTl70-bqYdf7gXUscC6AI82Kbd8namWWXmfknZ0J9/n/grrjnyzvhu1t/b/General_ltrace_files/o/GeoSlicer/base/release/linux/GeoSlicer-2.2.2-2024-04-01-linux-amd64.tar.gz) or built from source using the [geoslicerbase](https://github.com/ltracegeo/geoslicerbase) and [slicer](https://github.com/ltracegeo/Slicer) repositories.
30+
GeoSlicer-base can be obtained from pre-built binaries available for [windows](https://objectstorage.sa-saopaulo-1.oraclecloud.com/p/j3-M11OKFLGFcWJGYr4hUQnW8u4sFruUATaH2IcaoSp4f8PcRCisaQH6mH2rtGv0/n/grrjnyzvhu1t/b/General_ltrace_files/o/GeoSlicer/base/release/win32/GeoSlicer-2.2.2-2024-11-21-win-amd64.zip) and [linux](https://objectstorage.sa-saopaulo-1.oraclecloud.com/p/jy3VVQsDEJb9lVRLUz-6Iu_FBwPpw8ooCPdHP9aXKfEJPvWrFPt2Gy2hxwSy3mnq/n/grrjnyzvhu1t/b/General_ltrace_files/o/GeoSlicer/base/release/linux/GeoSlicer-2.2.2-2024-11-21-linux-amd64.tar.gz) or built from source using the [geoslicerbase](https://github.com/ltracegeo/geoslicerbase) and [slicer](https://github.com/ltracegeo/Slicer) repositories.
2731

2832
## Repository Structure
2933

@@ -60,11 +64,11 @@ This project uses 3D Slicer version 4.11 and beyond with support for Python 3.9.
6064

6165
1. Download the Visual Studio Community 2019 (https://visualstudio.microsoft.com/downloads/) and execute the installer. Under the tab "Individual components", select only: MSVC v142 for x64/x86 (14.29).
6266

63-
1. Download (https://developer.nvidia.com/cuda-11.2.0-download-archive) and install CUDA 11.2.
67+
1. Download (https://developer.nvidia.com/cuda-11-6-2-download-archive) and install CUDA 11.6.2.
6468

65-
1. Download (https://developer.nvidia.com/cudnn), unzip and copy the cuDNN 8.1 files to CUDA's installation directory (usually C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2) This operation should merge the "bin" folders of CUDA and CUDNN.
69+
1. Download (https://developer.nvidia.com/cudnn), unzip and copy the cuDNN 8.9.7 files to CUDA's installation directory (usually C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6) This operation should merge the "bin" folders of CUDA and CUDNN.
6670

67-
1. Check your environment variables. You should have a variable CUDA_PATH_V11_2 pointing to CUDA's installation directory.
71+
1. Check your environment variables. You should have a variable CUDA_PATH_V11_6 pointing to CUDA's installation directory.
6872

6973
2. Download GeoSlicer base from the URLs at the INTRO section
7074

@@ -192,4 +196,8 @@ git commit -m 'Example' -n
192196

193197
- Carneiro, I., Sapucaia, V., Bordignon, F., Figueiredo, L., Honório, B., & Matias, J. (2024). Application of MPS to Image Log and CoreCT Images Inpainting. 85th EAGE Annual Conference & Exhibition, [2024](https://www.earthdoc.org/content/papers/10.3997/2214-4609.2024101489)(1), 1-5.
194198

195-
- Carneiro, I., Souza, J., Zanellato, D., Mei, M., Sapucaia, V., Figueiredo, L., Bordignon, F., Matias, J., Honório, Bruno César Zanardo, & Surmas, R. (2024). Multiscale analysis of carbonate rocks for the digital rocks platform GeoSlicer, an open source plugin. ROG.e 2024, [2024](https://biblioteca.ibp.org.br/pt-BR/search/49511)(2975).
199+
- Carneiro, I., Souza, J., Zanellato, D., Mei, M., Sapucaia, V., Figueiredo, L., Bordignon, F., Matias, J., Honório, Bruno César Zanardo, & Surmas, R. (2024). Multiscale analysis of carbonate rocks for the digital rocks platform GeoSlicer, an open source plugin. ROG.e 2024, [2024](https://biblioteca.ibp.org.br/pt-BR/search/49511)(2975).
200+
201+
- Arenhart, R., Bordignon, F., Figueiredo, L., Pereira, M., Formighieri, G., Pacheco, R., Cenci R., & Surmas, R. (2025). Geoslicer open source platform for digital rock image analysis. 5th International Rock Imaging Summit, [2025](https://www.rockimaging.org/risig_iris_2025_program_detail.php?abstractID=276)
202+
203+
- Arenhart, R., Bordignon, F., Figueiredo, L., Pereira, M., Formighieri, G., Pacheco, R., Cenci R., Melo, R., & Surmas, R. (2025). A Multiscale Approach to Pore-Network Two-Phase Flow Simulation Applied to a Carbonate Reservoir. 17th Annual Meeting Interpore, [2025](https://events.interpore.org/event/56/contributions/7844/contribution.pdf)

docker-compose.yml

Lines changed: 0 additions & 64 deletions
This file was deleted.

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
[build-system]
22
requires = [
3-
"setuptools==60.2.0",
3+
"setuptools==61.3.1",
44
"wheel==0.37.0",
55
"Cython==0.29.28",
66
"vswhere==1.3.0",
77
"patch==1.16",
8-
"packaging==23.2"
8+
"packaging==23.2",
9+
"setuptools-scm>=8"
910
]
1011

1112
[tool.autopep8]

src/ltrace/ltrace/algorithms/big_image/boundary_removal.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import SimpleITK as sitk
22
import dask
3+
import dask.array as da
34
import numpy as np
45
from typing import Union
56

@@ -17,11 +18,14 @@ def _apply_filter(dataArray: "dask.array.core.Array", origin: tuple, spacing: tu
1718

1819

1920
def _apply_threshold(
20-
dataArray: "dask.array.core.Array", segmentsDataArray: "dask.array.core.Array", thresholds: tuple
21+
dataArray: "dask.array.core.Array",
22+
segmentsDataArray: "dask.array.core.Array",
23+
mask: "dask.array.core.Array",
24+
thresholds: tuple,
2125
) -> "dask.array.core.Array":
2226
thresholdMin, thresholdMax = thresholds
2327

24-
segmentedArray = np.where((dataArray >= thresholdMin) & (dataArray <= thresholdMax), 0, segmentsDataArray)
28+
segmentedArray = np.where((dataArray >= thresholdMin) & (dataArray <= thresholdMax) & mask, 0, segmentsDataArray)
2529
return segmentedArray
2630

2731

@@ -31,12 +35,18 @@ def remove_boundaries(
3135
origin: tuple,
3236
spacing: tuple,
3337
thresholds: tuple,
38+
microporosityIndex: int = None,
3439
) -> Union[None, "dask.array.core.Array"]:
3540
if dataArrayBlock is None or segmentationArrayBlock is None:
3641
return None
3742

3843
filteredArray = _apply_filter(dataArray=dataArrayBlock, origin=origin, spacing=spacing)
44+
mask = (
45+
(segmentationArrayBlock == microporosityIndex)
46+
if microporosityIndex is not None
47+
else da.ones(filteredArray.shape, dtype=bool)
48+
)
3949
filteredSegmentedArray = _apply_threshold(
40-
dataArray=filteredArray, segmentsDataArray=segmentationArrayBlock, thresholds=thresholds
50+
dataArray=filteredArray, segmentsDataArray=segmentationArrayBlock, mask=mask, thresholds=thresholds
4151
)
4252
return filteredSegmentedArray

src/ltrace/ltrace/algorithms/big_image/expand_segments.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ def expand_segments(
77
segmentationArrayBlock: "dask.array.core.Array",
88
origin: tuple,
99
spacing: tuple,
10+
microporosityIndex: int = None,
1011
) -> "np.ndarray":
1112
filter = sitk.MorphologicalWatershedFromMarkersImageFilter()
1213
filter.FullyConnectedOff()
1314
filter.MarkWatershedLineOff()
1415

16+
if microporosityIndex is not None:
17+
microporosity = segmentationArrayBlock == microporosityIndex
18+
segmentationArrayBlock[microporosity] = 0
19+
1520
segmentation = sitk.GetImageFromArray(segmentationArrayBlock.astype(np.uint8))
1621
segmentation.SetSpacing(spacing)
1722
segmentation.SetOrigin(origin)
@@ -23,4 +28,7 @@ def expand_segments(
2328
result = filter.Execute(image, segmentation)
2429
result = sitk.GetArrayFromImage(result)
2530

31+
if microporosityIndex is not None:
32+
result[microporosity] = microporosityIndex
33+
2634
return result

src/ltrace/ltrace/algorithms/detect_cups.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ def otsu_threshold(img):
1414
kernel = np.ones((3, 3), np.uint8)
1515
threshold_image = cv2.erode(threshold_image, kernel, iterations=EROSION_AMOUNT)
1616
contours = cv2.findContours(threshold_image, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)[0]
17+
if not contours:
18+
return None
1719
contour = max(contours, key=cv2.contourArea)
1820
mask = np.zeros_like(threshold_image)
1921
cv2.drawContours(mask, [contour], -1, 255, -1)
@@ -70,6 +72,9 @@ def detect_rock_circle(array):
7072
geometric_mean = np.power(acc, 1 / 8)
7173

7274
mask = otsu_threshold(geometric_mean)
75+
if mask is None:
76+
return None
77+
7378
min_radius = round(array.shape[1] * 0.15)
7479
max_radius = round(array.shape[1] * 0.5)
7580
circles = cv2.HoughCircles(
@@ -143,6 +148,9 @@ def detect_rock_height(array, circle_center_x, circle_radius):
143148

144149

145150
def detect_rock_cylinder(array):
151+
if array.size == 0:
152+
return None
153+
146154
should_downscale = min(array.shape) > 500
147155

148156
if should_downscale:

0 commit comments

Comments
 (0)