This Matlab App supports the analysis of 31P and 1H signals from MRI scans. It allows users to:
- Visualize images in 2D and 3D
- Segment images in 2D
- Apply local B1-correction
- Apply calibration curves to extract physical measurements
- Perform ROI-based processing
- Export modified images
The interface was tested with 64 × 64 × 64 images, but other dimensions should also work.
BoneQuantMRI/
├── app/ # App source (BoneQuantMRI.mlapp)
│ └── BoneQuantMRI.mlapp
│
├── deployment/ # Standalone app and deployment script
│ └── Mac-AppleSilicon/
│ └── output/
│ └── package/
│ └── installBoneQuantMRI.app # Installable macOS app
│
├── documentation/ # Manual and reference documentation
│ └── UserManual.md
│
├── resources/ # Images/icons used inside BoneQuantMRI.prj
│ ├── topbar_long.png
│ ├── icon-2.png
│ └── ...
│
├── LICENSE # License file (non-commercial use only)
└── README.md # This file
A compiled version of the app is included:
deployment/Mac-AppleSilicon/output/package/installBoneQuantMRI.app
- Download the folder to your Mac (Apple Silicon).
- Double-click
installBoneQuantMRI.appand follow the installer instructions. - The installer includes the MATLAB Runtime.
- Launch the app from your Applications folder like any other macOS app.
Tested on macOS Ventura (13.0) and newer.
- Data: Load raw image and B1 correction image. The B1 image is downscaled automatically.
- Slice Browser: View images in sagittal, coronal, or axial planes. Use the 3D button to view the result.
- Segmentation: Manually adjust ROI for bone and phantom. Save/load masks.
- ROI Analysis: Define trabecular and cortical regions. A third (growth plate) is inferred. Auto-segmentation uses Otsu's method.
- Results: ROI types: Cortical, Trabecular, Growth Plate. Metrics: Volume, mean/median intensity (Tissue vs Bone).
- Install MATLAB R2019a or newer: MathWorks Trials
- Open MATLAB → Use the Workspace Browser to open
MRI_Bone_Analysis.mlapp - App Designer opens → Press Run
- The application window launches after pressing Run.
- Use "Select DICOM for Raw image" and "Select DICOM for B1 image"
- Use Slice Browser controls
- Display options (colormap, enhanced contrast) in Data Processing tab
- Turn off overlays for exporting images
- Use the 3D button for visualizing the final image
- MATLAB's
volumeVieweris used under the hood
- Auto-segmented regions:
- Green: specimen
- Blue: phantom
- Red/Black: holes
- Adjust threshold as needed (resets manual contours!)
- Press Resegment → Manual tool appears
- Draw ROI for phantom (blue) and bone (green)
- Use "New ROI" before each action
- Navigate slices → Save to same folder as image
- Use Load button to reload masks
- Use sliders to define Cortical (C) and Trabecular (T) regions
- GPA region is auto-computed
- "Guess" estimates standard ROI sizes
- Set reference density (e.g., 0.71)
- Choose 1-point or 2-point calibration modes
- Optionally set segmentation threshold (e.g., 4255)
- Enable/disable B1-correction
- Use "Single" button to populate results
- Clicking a cell copies results to clipboard (paste in Excel)
- Use Export menu to save calibrated images as 3D DICOM stacks
- Folder structure:
Run-1/Set-1/*.DCM - Do not select subfolders like
Set-1 - Press "Auto" and select
Run-1 - Ensure B1 file is preloaded
- TV: Total Volume
- BV: Bone Volume
- V_cort: Cortical Volume
- V_trab: Trabecular Volume
- Bone D.: Mean Bone Density
- Tissue D.: Mean Tissue Density (Cortical, Trabecular, GPA)
- Phantom / Noise: Mean phantom or background values
Switch to Code View in App Designer to customize:
- Document changes in the program header
- Code sections:
- Properties = Global variables
- Private functions = Main logic (top-to-bottom workflow)
- Callbacks = GUI component responses (ordered by creation)
This project is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
You are free to share and adapt the software under the following terms:
- Attribution — You must give appropriate credit.
- NonCommercial — You may not use the material for commercial purposes.
- ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license.
See the LICENSE file for full terms.
When using this software or any modifications of it please cite the following works:
Kassey, V.B., Walle, M., Egan, J., Yeritsyan, D., Beeram, I., Kassey, S.P., Wu, Y., Snyder, B.D., Rodriguez, E.K., Ackerman, J.L. and Nazarian, A., 2024. Quantitative 1H Magnetic Resonance Imaging on Normal and Pathologic Rat Bones by Solid‐State 1H ZTE Sequence with Water and Fat Suppression. Journal of Magnetic Resonance Imaging, 60(6), pp.2423–2432.
Kassey, V.B., Walle, M., Egan, J., Yeritsyan, D., Beeram, I., Wu, Y., Snyder, B.D., Rodriguez, E.K., Ackerman, J.L. and Nazarian, A., 2024. Quantitative 31P magnetic resonance imaging on pathologic rat bones by ZTE at 7T. Bone, 180, p.116996.
The app behaves unexpectedly / I see an error.
- Check the MATLAB command window for detailed errors
- If reproducible, send bug report with steps and error to:
matthias.walle@gmail.com
How should my data be structured for automatic mode?
Folder1/
├─ FolderA/*.DCM
├─ FolderB/*.DCM
└─ FolderC/*.DCM
Do not select subfolders. Place all folders to process into one root folder.
How can I export a screenshot of a slice?
- Adjust settings in Slice Browser and Data Processing tab
- Use the export button in the corner of the image
- Or use the
.figbutton to open as MATLAB figure → Export
Why do calibration phantoms look different across images?
- MATLAB auto-adjusts grayscale contrast for display
- Use colormap or extract values from the results table to compare actual densities
Tested from MATLAB R2019a to R2025a.
For questions or contributions, email matthias.walle@gmail.com
