This project is a single-page React application that loads and visualizes 3D NIfTI images using the NIfTI-Reader-JS library.
https://rednet09.github.io/3dslider/
- Upload a NIfTI file from your local machine.
- Display the Axial Image of the 3D NIfTI file.
- Navigate through the slices of the 3D image using a slider.
- Node.js
- npm (Node package manager)
-
Clone the repository:
git clone https://github.com/your-username/3dslider cd 3dslider
-
Install the necessary packages:
npm install
-
Install and configure Tailwind CSS:
npm install -D tailwindcss postcss autoprefixer npx tailwindcss init -p
-
Configure
tailwind.config.js
:/** @type {import('tailwindcss').Config} */ module.exports = { content: ["./src/**/*.{js,jsx,ts,tsx}"], theme: { extend: {}, }, plugins: [], };
-
Add Tailwind CSS directives to
src/index.css
:@tailwind base; @tailwind components; @tailwind utilities;
-
Import
index.css
insrc/index.js
:import "./index.css";
-
Start the development server:
npm run dev
-
Open your web browser and go to
http://localhost:5173
.
- Click on the file upload button to select a NIfTI file from your local machine.
- Use the slider to navigate through the slices of the 3D image.
- The selected slice will be displayed on the canvas.
- src/
- components/
- FileUpload.js # Component for handling file uploads
- ImageSlider.js # Component for the slider navigation
- ImageViewer.js # Component for displaying the NIfTI image slices
- App.js # Main component that manages state and handles file uploads
- index.js # Entry point of the React application
- index.css # Tailwind CSS configuration
- React - A JavaScript library for building user interfaces
- NIfTI-Reader-JS - Library for reading NIfTI files
- Tailwind CSS - Utility-first CSS framework for rapid UI development
This project is licensed under the MIT License - see the LICENSE file for details.
- This project utilizes the NIfTI-Reader-JS library for handling NIfTI files.
- Thanks to the developers of React and Tailwind CSS for providing great tools for building this application.
You can download an example NIfTI file to test the application from this link.
Contributions are welcome! Please feel free to submit a Pull Request.