https://github.com/cnpem/annotat3d
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.7%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: cnpem
- License: gpl-3.0
- Language: HTML
- Default Branch: main
- Size: 25.4 MB
Statistics
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Annotat3D
Description
Annotat3D is a modern web application designed for interactive segmentation of volumetric images, tailored to meet the needs of the imaging beamlines at Sirius.
Annotat3D leverages human-in-the-loop strategies to facilitate the annotation of large tomographic datasets, enabling domain experts to inject their knowledge efficiently while collaborating with machine learning models. Here are the main features of Annotat3D:
- High-Performance Image Segmentation: Optimized for multi-GPU clusters, enabling efficient processing of large-scale datasets.
- Intuitive Web Interface: Provides tools for annotating, correcting, and managing labels in an accessible and user-friendly environment.
- Real-Time Visualization: Offers low-latency visualization of raw data, annotations, and predictions to ensure immediate feedback and streamlined workflows.
- Advanced Filtering Tools: A comprehensive suite of high-performance filters designed for HPC environments, enhancing image quality and reducing noise with exceptional speed and precision.
- Active Contour Models: Seamless automatic annotation and label correction powered by active contour models, improving efficiency and accuracy in label refinement.
- HPC-Optimized Morphological Operations: A robust suite of morphological operations, specifically implemented for HPC environments, to refine segmentation with precision and scalability.
Project Status
Active development is ongoing with new features and optimizations planned for future releases.
Project Files
The repository is organized into the following main directories:
Backend: backend/sscAnnotat3D/
The back-end implementation handles high-performance computing and API services.
api/: Defines API endpoints for communication between the front end and back end.modules/: Modularized functionalities for API services.
colormaps/: Colormap definitions for visualizing segmented data.cython/: High-performance modules implemented with Cython.help/: Help documentation and resources for the back-end.modules/: Core logic for segmentation and visualization tasks.repository/: Data access and storage utilities.static/: Static assets (e.g., images, JSON files) served by the back-end.templates/: HTML templates for server-side rendering.
Public Assets: public/assets/
Static assets used by the front-end application.
icon/: Icons for various UI elements.
Specifications and Documentation: spec/docs/
Resources related to specifications, scripts, and documentation.
scripts/: Helper scripts for generating or processing documentation.styles/: Styles for documentation presentation.
Frontend Source: src/
The front-end implementation using React and modern web technologies.
components/: Reusable UI components.canvas/: Handles rendering and interactions on the visualization canvas.main_menu/: Components for the main menu interface.file/: File management operations.utils/: Utility functions for file handling.
tools_menu/: Tools for segmentation, annotation, and visualization.annotation_menu/: Annotation-related tools and components.label_table/: Displays and manages annotation labels.label_tools/: Tools for label manipulation.ThresholdComponents/: Threshold-based segmentation tools.GlobalComponents/: Tools for global thresholding operations.LocalComponents/: Tools for localized thresholding operations.
module_menu/: Advanced modules for segmentation and visualization.utils/: Shared utilities for tools.vis_menu/: Visualization settings and tools.
pages/: Top-level components for application views and routing.public/: Public-facing assets for the front-end application.styles/: CSS and styling files.theme/: Configuration files for the application’s theme.utils/: Shared utility functions.
Installation
The Annotat3D project can be built and deployed using either Docker or Singularity, ensuring flexibility for different environments. Follow the steps below based on your preferred containerization technology.
Prerequisites
- Docker or Singularity installed on your system:
- Python 3 installed for generating container recipes.
Building with Docker
To build and run Annotat3D using Docker:
Clone the repository:
bash git clone https://github.com/your-username/annotat3d.git cd annotat3dGenerate the
Dockerfileand build the Docker image:bash bash container/build_docker.sh
This script will:
- Generate a Dockerfile using an HPCCM recipe (container/hpccm-cuda-gcc-openmpi-hdf-conda.py).
- Build the Docker image and tag it as gitregistry.cnpem.br/gcd/data-science/segmentation/annotat3dweb.
Run the Docker container:
bash docker run -d -p 3000:3000 gitregistry.cnpem.br/gcd/data-science/segmentation/annotat3dwebAccess the web application at
http://localhost:3000.
Building with Singularity
To build and run Annotat3D using Singularity:
Clone the repository:
bash git clone https://github.com/your-username/annotat3d.git cd annotat3dGenerate the Singularity recipe and build the Singularity image:
bash bash container/build_singularity.sh
This script will:
- Generate a Singularity definition file (container/Singularity.def) using the HPCCM recipe.
- Build the Singularity image (annotat3dweb.sif).
- Run the Singularity container:
bash singularity exec annotat3dweb.sif ./start-server.sh
Replace ./start-server.sh with the appropriate script or command to start the Annotat3D service.
- Access the web application at
http://localhost:3000.
Notes
- HPCCM Recipe: The
container/hpccm-cuda-gcc-openmpi-hdf-conda.pyscript generates recipes for both Docker and Singularity containers, ensuring compatibility with HPC environments. - Ensure you execute the build scripts from the project’s root directory to avoid path issues.
- If additional dependencies are required, update the HPCCM recipe file before building the image.
Usage
For Users
- Load a volumetric dataset in
.h5format via the GUI. - Annotate slices using the interactive tools.
- Use machine learning-powered segmentation and preview results.
For Developers
To set up a development environment:
bash
python -m pip install -r requirements.txt
Code Development Standards
General Guidelines
Version Control:
- Use meaningful commit messages that describe what the change accomplishes (e.g.,
fix: resolve issue with API endpoint timeoutorfeat: add annotation preview feature). - Adhere to Git workflows (e.g., feature branches for new development, pull requests with proper code reviews before merging).
- Use meaningful commit messages that describe what the change accomplishes (e.g.,
Code Documentation:
- Use clear and concise comments to explain complex logic.
- Ensure that every function and class has a docstring explaining its purpose, inputs, and outputs (e.g., adhere to the Google or NumPy docstring format).
Python Standards
Imports:
- Use relative imports for internal modules within the same package.
- Avoid absolute imports; instead, rely on what is exposed publicly via
__init__.pyfiles in a module. - Group imports in the following order:
- Standard library imports.
- Third-party library imports.
- Internal imports.
Example:
python import os import numpy as np from .utils import compute_gradients
Module Structure:
- Organize related classes and functions into modules and sub-packages for clarity and reusability.
- Classes, methods, and settings intended for external use must be explicitly exposed in the
__init__.pyfile. - Name private modules, functions, and variables with a leading underscore (e.g.,
_helper_function,_private_module).
Coding Style:
- Follow PEP 8 for Python coding style.
- Use type hints and annotations for all functions:
python def calculate_area(radius: float) -> float: return 3.14 * radius ** 2 - Limit line length to 79 characters (or 120 characters for comments and docstrings).
Testing:
- Write unit tests for all major functions and modules using pytest or a similar framework.
- Maintain a minimum test coverage of 80% or higher for new code.
Error Handling:
- Always handle exceptions gracefully, and avoid generic exceptions like
except:. - Log errors with context to facilitate debugging.
- Always handle exceptions gracefully, and avoid generic exceptions like
React Standards
Component Structure:
- Use functional components with React Hooks for new features unless class components are explicitly required.
- Keep components small and focused, following the single responsibility principle.
File Organization:
- Use a feature-based folder structure, grouping related components, hooks, styles, and utilities together.
Example:
src/ ├── components/ │ └── Button/ │ ├── Button.jsx │ ├── Button.test.jsx │ ├── Button.module.css │ └── index.js
- Use a feature-based folder structure, grouping related components, hooks, styles, and utilities together.
Example:
State Management:
- Use React Context or a state management library like Redux or Zustand when the state needs to be shared across components.
- Keep local state inside components if it does not need to be shared.
Coding Style:
- Follow ESLint with an Airbnb or similar style guide.
- Use Prettier for consistent formatting.
- Prefer destructuring for cleaner and more readable code:
javascript const { name, age } = props;
Testing:
- Write tests using Jest and React Testing Library to ensure components render and behave correctly.
- Strive for comprehensive coverage, including edge cases.
Error Handling:
- Use error boundaries to catch errors in React components.
- Handle asynchronous errors with proper
try-catchblocks.
Commit and Code Review Best Practices
- Use meaningful branch names, e.g.,
feature/add-annotation-toolorbugfix/fix-docker-build. - Squash commits into meaningful units before merging to the main branch.
- Conduct code reviews to maintain code quality, focusing on:
- Readability.
- Adherence to standards.
- Test coverage.
Deployment
To deploy a new version:
1. Update the version number in pyproject.toml.
2. Build the package:
bash
python -m build
3. Upload to PyPI:
bash
twine upload dist/*
Contributing
We welcome contributions of all kinds to improve and expand Annotat3D! Whether you're fixing a bug, adding a new feature, improving the documentation, or suggesting ideas, your contributions make a difference.
How to Contribute
Fork the Repository
- Click the Fork button at the top-right of the repository page to create your own copy.
Clone Your Fork
- Clone the forked repository to your local machine:
bash git clone https://github.com/your-username/annotat3d.git cd annotat3d
- Clone the forked repository to your local machine:
Create a Branch
- Create a new branch for your changes:
bash git checkout -b feature/your-feature-name
- Create a new branch for your changes:
Make Your Changes
- Follow the Code Development Standards.
- Ensure your changes are well-documented and include relevant test cases.
Test Your Changes
- Run tests to verify your changes:
bash pytest
- Run tests to verify your changes:
Commit and Push
- Commit your changes with a meaningful message:
bash git commit -m "feat: add feature description" - Push your branch:
bash git push origin feature/your-feature-name
- Commit your changes with a meaningful message:
Open a Pull Request (PR)
- Go to the original repository, click Pull Requests, and submit a new PR.
- Add a clear description of your changes and why they are needed.
Engage in the Review Process
- Respond to feedback and suggestions during the review process. Your PR will be merged once approved.
Other Ways to Contribute
Not a coder? No problem! You can still contribute in other ways:
Report Issues:
- Found a bug or have a feature request? Open an issue in the Issues tab.
Improve Documentation:
- Help us keep the documentation up-to-date by fixing typos, clarifying instructions, or expanding examples.
Participate in Discussions:
- Share ideas and provide feedback in the Discussions tab.
Triage Issues:
- Help label and organize issues to make them easier for contributors to pick up.
Need Help?
If you need help getting started or have any questions, feel free to: - Open a discussion in the Discussions tab. - Reach out to the maintainers listed in the Contributors section.
We look forward to your contributions! 🎉
Contributors
- 👤 Allan Pinto
- 👤 Egon Borges
- 👤 Ricardo Grangeiro
- 👤 Camila Machado de Araújo
Former Contributors
- Alan Peixinho
- Allan Pinto
- Bruno Carlos
- Eduardo X. Miqueles
- Gabriel Borin
- Giovanna Antonieti
- Henrique Gonçalves
- Jhessica Silva
- Matheus Bernardi
- Matheus Sarmento
- Paulo Mausbach
- Thiago Spina
- Victor Cesaroni
- Vitória Pinho
License
This project is licensed under the GNU General Public License v3.0.
Summary of the License
You are free to:
- Use: Run the software for any purpose.
- Study: Access and modify the source code.
- Share: Distribute copies of the software.
- Contribute: Distribute modified versions of the software.
Requirements:
- If you distribute copies or modified versions, you must make the source code available under the same license.
- Any changes you make to the software must be clearly documented.
- You cannot add restrictions that would deny other users the freedoms granted by this license.
For more details, see the full license text in the LICENSE file or visit the GNU GPL v3.0 page.
By using or modifying this software, you agree to the terms and conditions outlined in the license.
Owner
- Name: Brazilian Center for Research in Energy and Materials (CNPEM)
- Login: cnpem
- Kind: organization
- Location: Brazil
- Website: https://cnpem.br/
- Repositories: 1
- Profile: https://github.com/cnpem
GitHub Events
Total
- Issues event: 1
- Delete event: 1
- Public event: 1
- Push event: 1
- Create event: 1
Last Year
- Issues event: 1
- Delete event: 1
- Public event: 1
- Push event: 1
- Create event: 1
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| gabriel.macedo | g****o@l****r | 270 |
| Allan Pinto | a****o@l****r | 144 |
| Egon Borges | e****s@l****r | 119 |
| Alan Peixinho | a****1@g****m | 101 |
| Bruno Carlos | b****s@l****r | 83 |
| gabriel.macedo | b****o@g****m | 67 |
| ricardo.grangeiro | r****o@l****r | 35 |
| Paulo Baraldi Mausbach | p****h@l****r | 13 |
| Camila Machado de Araujo | c****o@l****r | 11 |
| matheus.bernardi | m****i@l****r | 7 |
| Egon Piragibe Barros Silva Borges | e****s@h****r | 2 |
| Daniel Tavares | d****t | 1 |
| brunocarlos_lnls | b****s@p****n | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- fbordignon (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- nvcr.io/nvidia/cuda 11.2.2-cudnn8-devel-ubuntu20.04 build
- @babel/plugin-proposal-private-property-in-object ^7.21.11 development
- @capacitor/cli ^5.0.4 development
- @commitlint/cli ^17.6.3 development
- @iceworks/spec ^1.6.0 development
- @ionic/lab 3.2.11 development
- @types/lodash.debounce ^4.0.7 development
- @types/lodash.isequal ^4.5.6 development
- @typescript-eslint/eslint-plugin ^5.59.7 development
- @typescript-eslint/parser ^5.59.7 development
- eslint ^8.41.0 development
- eslint-config-airbnb ^19.0.4 development
- eslint-config-airbnb-typescript ^17.0.0 development
- eslint-config-prettier ^8.8.0 development
- eslint-config-standard-with-typescript ^34.0.1 development
- eslint-import-resolver-typescript ^3.5.5 development
- eslint-plugin-import ^2.27.5 development
- eslint-plugin-jsx-a11y ^6.7.1 development
- eslint-plugin-n ^15.7.0 development
- eslint-plugin-prettier ^4.2.1 development
- eslint-plugin-promise ^6.1.1 development
- eslint-plugin-react ^7.32.2 development
- eslint-plugin-react-hooks ^4.6.0 development
- lint-staged ^13.2.2 development
- prettier ^2.8.8 development
- react-scripts ^5.0.1 development
- stylelint ^15.6.2 development
- stylelint-config-recommended ^12.0.0 development
- @capacitor/app 1.1.1
- @capacitor/core 3.4.3
- @capacitor/haptics 1.1.4
- @capacitor/keyboard 1.2.2
- @capacitor/status-bar 1.0.8
- @ionic/core ^7.0.10
- @ionic/react ^6.0.0
- @ionic/react-router ^6.0.0
- @testing-library/jest-dom ^5.11.9
- @testing-library/react ^11.2.5
- @testing-library/user-event ^12.6.3
- @types/colormap ^2.3.4
- @types/jest ^26.0.20
- @types/lodash ^4.14.180
- @types/ndarray ^1.0.11
- @types/node ^12.19.15
- @types/react ^16.14.3
- @types/react-color ^3.0.6
- @types/react-dom ^16.9.10
- @types/react-router ^5.1.11
- @types/react-router-dom ^5.1.7
- better-docs ^2.7.2
- bootstrap ^5.1.3
- chart.js ^4.0.0
- chartjs-plugin-annotation ^3.0.1
- colormap ^2.3.2
- dotenv ^16.4.5
- ionicons ^5.4.0
- jsdoc ^4.0.2
- lodash ^4.17.21
- lodash.debounce ^4.0.8
- lodash.isequal ^4.5.0
- ndarray ^1.0.19
- npyjs ^0.2.1
- pako ^2.0.4
- pixi-viewport 4.34.4
- pixi.js ^6.5.10
- react ^17.0.2
- react-bootstrap ^2.2.1
- react-chartjs-2 ^5.2.0
- react-color ^2.19.3
- react-dom ^17.0.2
- react-router ^5.2.0
- react-router-dom ^5.2.0
- react-storage-hooks ^4.0.1
- taffydb ^2.7.3
- typescript 5.0.4
- web-vitals ^0.2.4
- workbox-background-sync ^5.1.4
- workbox-broadcast-update ^5.1.4
- workbox-cacheable-response ^5.1.4
- workbox-core ^5.1.4
- workbox-expiration ^5.1.4
- workbox-google-analytics ^5.1.4
- workbox-navigation-preload ^5.1.4
- workbox-precaching ^5.1.4
- workbox-range-requests ^5.1.4
- workbox-routing ^5.1.4
- workbox-strategies ^5.1.4
- workbox-streams ^5.1.4
- black >=24.3.0 development
- breathe * development
- click >=8.1.3 development
- commitizen >=3.20.0 development
- flake8 >=7.0.0 development
- flake8-docstrings >=1.6.0 development
- gitlint >=0.19.1 development
- interrogate >=1.5.0 development
- isort >=5.13.2 development
- pre-commit * development
- pytest ==6.1.2 development
- sphinx-js >=3.2.2 development
- sphinx-rtd-theme * development
- versioneer >=0.29 development
- charset-normalizer ==2.1.1
- flask >=3.0.3
- flask-cors ==3.0.10
- h5py ==3.6.0
- harpia ==2.2.1
- jinja2 >=3.1.2
- numpy ==1.22.3
- opencv-python ==4.9.0.80
- protobuf ==3.20
- psutil ==5.9.8
- python-dotenv ==1.0.1
- scikit-image ==0.18.3
- sentry-sdk >=2.6.0
- sscIO >=0.2.1
- sscPySpin >=0.6.0
- werkzeug >=3.0.0