{"id":22189690,"url":"https://github.com/squareys/imglib-itk-experiments","last_synced_at":"2025-03-24T20:21:25.218Z","repository":{"id":73224304,"uuid":"49816791","full_name":"Squareys/imglib-itk-experiments","owner":"Squareys","description":"ITK integration for imagej","archived":false,"fork":false,"pushed_at":"2016-01-21T16:27:58.000Z","size":25,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-20T09:19:57.311Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Squareys.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-17T12:44:10.000Z","updated_at":"2016-01-22T09:35:40.000Z","dependencies_parsed_at":"2023-03-04T05:15:40.981Z","dependency_job_id":null,"html_url":"https://github.com/Squareys/imglib-itk-experiments","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Squareys%2Fimglib-itk-experiments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Squareys%2Fimglib-itk-experiments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Squareys%2Fimglib-itk-experiments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Squareys%2Fimglib-itk-experiments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Squareys","download_url":"https://codeload.github.com/Squareys/imglib-itk-experiments/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245343981,"owners_count":20599867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-02T11:20:06.372Z","updated_at":"2025-03-24T20:21:25.170Z","avatar_url":"https://github.com/Squareys.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# imagej-itk\nProof of concept for how to integration SimpleITK with Imglib2 while trying to avoid copying data whereever possible.\n\n## Introduction\nThis repository is of no use to the majority of the imagej user base but rather tries to be a basis for future work of imagej/imglib2 developers.\n\nThe code tries to integration SimpleITK with Imglib2 in two ways: Using access to java array and using a ByteBuffer.\nThe two approaches will be elaborated on in the next sections.\n\n## Copy the Data Approach\nThe straight-forward approach of creating a SimpleITK `Image` from any kind of imglib2 image structure would be to create the `org.itk.simple.Image`\nand copy the data pixel by pixel.\n\n## Java Array Access Approach\nThe idea behind this approach is to access an `ArrayImg` data storage array from JNI and create a SimpleITK Image from it.\nTheoretically, this will only copy the data when needed (see JNI documentation), but practically, the array data is allways copied, \nwhich therefore does not improve on the straight-forward approach very much.\n\n## DirectByteBuffer Approach\nWith `java.nio.DirectByteBuffer`, you can get direct access to data in the JVM in JNI. This approach does work, but requires `ArrayImg` to be created with\na backing `DirectByteBuffer`, so that data does not need to be copied into a new buffer and imglib2 does allow this. A drawback is that `DirectByteBuffer`\nsupposedly (performs a bit worse than `byte[]`)[http://www.evanjones.ca/software/java-bytebuffers.html], which is relevant for other uses of `ArrayImg` other\nthan sharing data with SimpleITK.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquareys%2Fimglib-itk-experiments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquareys%2Fimglib-itk-experiments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquareys%2Fimglib-itk-experiments/lists"}