Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 14 additions & 14 deletions .github/workflows/package-assetstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ on:
workflow_dispatch:

jobs:
package-unity-2019-4:
package-unity-2022-3:
runs-on: ubuntu-latest
container:
image: unityci/editor:ubuntu-2019.4.40f1-base-1.0.1
image: unityci/editor:ubuntu-2022.3.22f1-base-3
steps:
- uses: actions/checkout@v1
with:
- uses: actions/checkout@v4
with:
submodules: true
- name: Get dependencies
run: |
Expand All @@ -23,21 +23,21 @@ jobs:
chmod a+x scripts/ci/activate-license.sh
./scripts/ci/activate-license.sh
echo "Packaging..."
python scripts/ExportUnityPackage.py /opt/unity/Editor/Unity -assetstore -nodisplay
python3 scripts/ExportUnityPackage.py /opt/unity/Editor/Unity -assetstore -nodisplay
shell: bash
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE_BASE64 }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: EasyVolumeRenderer-Unity-2019.unitypackage
name: EasyVolumeRenderer-Unity-2022.3.unitypackage
path: EasyVolumeRenderer.unitypackage
package-unity-2021-3:
package-unity-6000-0:
runs-on: ubuntu-latest
container:
image: unityci/editor:ubuntu-2021.3.9f1-base-1.0.1
image: unityci/editor:ubuntu-6000.0.23f1-base-3
steps:
- uses: actions/checkout@v1
with:
- uses: actions/checkout@v4
with:
submodules: true
- name: Get dependencies
run: |
Expand All @@ -48,11 +48,11 @@ jobs:
chmod a+x scripts/ci/activate-license.sh
./scripts/ci/activate-license.sh
echo "Packaging..."
python scripts/ExportUnityPackage.py /opt/unity/Editor/Unity -assetstore -nodisplay
python3 scripts/ExportUnityPackage.py /opt/unity/Editor/Unity -assetstore -nodisplay
shell: bash
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE_BASE64 }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: EasyVolumeRenderer-Unity-2021.unitypackage
name: EasyVolumeRenderer-Unity-6000.0.unitypackage
path: EasyVolumeRenderer.unitypackage
28 changes: 14 additions & 14 deletions .github/workflows/package-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,45 @@ on:
workflow_dispatch:

jobs:
package-unity-2019-4:
package-unity-2022-3:
runs-on: ubuntu-latest
container:
image: unityci/editor:ubuntu-2019.4.40f1-base-1.0.1
image: unityci/editor:ubuntu-2022.3.22f1-base-3
steps:
- uses: actions/checkout@v1
with:
- uses: actions/checkout@v4
with:
submodules: true
- name: Package
run: |
chmod a+x scripts/ci/activate-license.sh
./scripts/ci/activate-license.sh
echo "Activation done. Packaging..."
python scripts/ExportUnityPackage.py /opt/unity/Editor/Unity -nodisplay
python3 scripts/ExportUnityPackage.py /opt/unity/Editor/Unity -nodisplay
shell: bash
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE_BASE64 }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: UnityVolumeRendering-2019.unitypackage
name: UnityVolumeRendering-2022.3.unitypackage
path: UnityVolumeRendering.unitypackage
package-unity-2021-3:
package-unity-6000-0:
runs-on: ubuntu-latest
container:
image: unityci/editor:ubuntu-2021.3.9f1-base-1.0.1
image: unityci/editor:ubuntu-6000.0.23f1-base-3
steps:
- uses: actions/checkout@v1
with:
- uses: actions/checkout@v4
with:
submodules: true
- name: Package
run: |
chmod a+x scripts/ci/activate-license.sh
./scripts/ci/activate-license.sh
echo "Activation done. Packaging..."
python scripts/ExportUnityPackage.py /opt/unity/Editor/Unity -nodisplay
python3 scripts/ExportUnityPackage.py /opt/unity/Editor/Unity -nodisplay
shell: bash
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE_BASE64 }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: UnityVolumeRendering-2020.3+.unitypackage
name: UnityVolumeRendering-6000.0.unitypackage
path: UnityVolumeRendering.unitypackage
8 changes: 4 additions & 4 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ jobs:
build:
runs-on: ubuntu-latest
container:
image: unityci/editor:ubuntu-2021.3.9f1-base-1.0.1
image: unityci/editor:ubuntu-2022.3.22f1-base-3
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
with:
submodules: true
- name: Package
run: |
chmod a+x scripts/ci/activate-license.sh
./scripts/ci/activate-license.sh
echo "Activation done. Packaging..."
python scripts/ExportUnityPackage.py /opt/unity/Editor/Unity -nodisplay
python3 scripts/ExportUnityPackage.py /opt/unity/Editor/Unity -nodisplay
shell: bash
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE_BASE64 }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: UnityVolumeRendering.unitypackage
path: UnityVolumeRendering.unitypackage
18 changes: 10 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
[Bb]uilds/
Assets/AssetStoreTools*
# Development project generated files
DevProject~/[Ll]ibrary/
DevProject~/[Tt]emp/
DevProject~/[Oo]bj/
DevProject~/[Bb]uild/
DevProject~/[Bb]uilds/
DevProject~/[Ll]ogs/
DevProject~/*.csproj
DevProject~/*.sln
DevProject~/Assets/AssetStoreTools*

# Visual Studio cache directory
.vs/

# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
Expand Down
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Changelog

All notable changes to the Unity Volume Rendering package will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2026-02-12

### Added
- Unity Package Manager (UPM) support. Install via git URL:
`https://github.com/mlavik1/UnityVolumeRendering.git`
- `package.json` with full UPM metadata and samples registration.
- Importable samples: "Basic Demo" (scene + camera controller) and "Sample Data"
(VisMale raw dataset, PARCHG VASP dataset).

### Changed
- Repository structure reorganized from a Unity project to a UPM package layout:
- `Assets/Scripts/` -> `Runtime/`
- `Assets/Editor/` -> `Editor/`
- `Assets/3rdparty/` -> `ThirdParty/`
- `Assets/Shaders/`, `Assets/Materials/`, `Assets/Textures/` -> `Runtime/`
- `Assets/Resources/` -> `Runtime/Resources/`
- `Assets/Scenes/` and sample scripts -> `Samples~/BasicDemo/`
- `DataFiles/` -> `Samples~/SampleData/`
- `Documentation/` -> `Documentation~/`
- Development Unity project -> `DevProject~/`

### Fixed
- Removed unused `using UnityEditor;` directives from `DatasetImporterUtility.cs`
and `ImporterUtilsInternal.cs`.

### Migration Guide
If you were previously using this project by cloning the repository and opening
it as a Unity project, you now have two options:
1. **Recommended**: Install via UPM git URL in your own project.
2. **For development**: Open `DevProject~/` as your Unity project.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The _RawDatasetImporter_ constructor takes the following parameters:
- endianness: The byte [endianness](https://en.wikipedia.org/wiki/Endianness) of the dataset.
- skipBytes: Number of bytes to skip before reading the content. This is used in cases where the dataset has a header. Some raw datasets formats store information about the dimension, format and endianness in a header. To import these datasets you can read the header yourself and pass this info to the _RawDatasetImporter_ constructor. The skipBytes parameter should then be equal to the header size.

All this info can be added to a ".ini"-file, which the importer will use (if it finds any). See the sample files (in the "DataFiles" folder for an example).
All this info can be added to a ".ini"-file, which the importer will use (if it finds any). See the sample files (in the "SampleData" folder for an example).

## Image file importer

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,31 @@ private static void ExtractZip(string zipPath, string extractDirPath)
}
}

private static string GetBinaryDirectoryPath()
private static string GetPluginRootPath()
{
string dataPath = Application.dataPath;
// Try UPM package resolution first
var packageInfo = UnityEditor.PackageManager.PackageInfo.FindForAssembly(typeof(SimpleITKManager).Assembly);
if (packageInfo != null)
{
return packageInfo.resolvedPath;
}

// Fallback: search for magic file in Assets (for .unitypackage import).
// The file is at the plugin root, so its directory is the plugin root path.
foreach (string file in Directory.EnumerateFiles(Application.dataPath, "*.*", SearchOption.AllDirectories))
{
// Search for magic file stored in Assets directory.
// This is necessary for cases where the UVR plugin is stored in a subfolder (thatæs the case for the asset store version)
if (Path.GetFileName(file) == "DONOTREMOVE-PathSearchFile.txt")
{
dataPath = Path.GetDirectoryName(file);
return Path.GetDirectoryName(file);
}
}
return Path.Combine(dataPath, "3rdparty", "SimpleITK"); // TODO: What is UVR is in a subfolder?

return Application.dataPath;
}

private static string GetBinaryDirectoryPath()
{
return Path.Combine(GetPluginRootPath(), "ThirdParty", "SimpleITK");
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "UnityVolumeRendering.Editor",
"rootNamespace": "UnityVolumeRendering",
"references": [
"UnityVolumeRendering.Runtime"
],
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class VolumeRendererEditorFunctions
[MenuItem("Volume Rendering/Load dataset/Load raw dataset")]
private static void ShowDatasetImporter()
{
string file = EditorUtility.OpenFilePanel("Select a dataset to load", "DataFiles", "");
string file = EditorUtility.OpenFilePanel("Select a dataset to load", "SampleData", "");
if (File.Exists(file))
{
RAWDatasetImporterEditorWindow wnd = (RAWDatasetImporterEditorWindow)EditorWindow.GetWindow(typeof(RAWDatasetImporterEditorWindow));
Expand Down Expand Up @@ -103,7 +103,7 @@ private static async void ImportNRRDDatasetAsync(bool spawnInScene)
return;
}

string file = EditorUtility.OpenFilePanel("Select a dataset to load (.nrrd)", "DataFiles", "");
string file = EditorUtility.OpenFilePanel("Select a dataset to load (.nrrd)", "SampleData", "");
if (File.Exists(file))
{
Debug.Log("Async dataset load. Hold on.");
Expand Down Expand Up @@ -154,7 +154,7 @@ private static void ImportNIFTIAsset()

private static async void ImportNIFTIDatasetAsync(bool spawnInScene)
{
string file = EditorUtility.OpenFilePanel("Select a dataset to load (.nii)", "DataFiles", "");
string file = EditorUtility.OpenFilePanel("Select a dataset to load (.nii)", "SampleData", "");
if (File.Exists(file))
{
Debug.Log("Async dataset load. Hold on.");
Expand Down Expand Up @@ -206,7 +206,7 @@ private static void ImportImageFileAsset()

private static async void ImporImageFileDatasetAsync(bool spawnInScene)
{
string file = EditorUtility.OpenFilePanel("Select a dataset to load", "DataFiles", "");
string file = EditorUtility.OpenFilePanel("Select a dataset to load", "SampleData", "");
if (File.Exists(file))
{
Debug.Log("Async dataset load. Hold on.");
Expand Down Expand Up @@ -258,7 +258,7 @@ private static void ImportParAsset()

private static async void ImportParDatasetAsync(bool spawnInScene)
{
string file = EditorUtility.OpenFilePanel("Select a dataset to load", "DataFiles", "");
string file = EditorUtility.OpenFilePanel("Select a dataset to load", "SampleData", "");
if (File.Exists(file))
{
Debug.Log("Async dataset load. Hold on.");
Expand Down
File renamed without changes.
22 changes: 0 additions & 22 deletions Packages/packages-lock.json

This file was deleted.

Loading