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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@ find_package( LibCarna "3.4.0" REQUIRED COMPONENTS release )
include_directories( ${LibCarna_INCLUDE_DIR} )
set( LIBCARNA_VERSION ${FOUND_VERSION} )

############################################
# Macro that sets variable to default value
# only when the variable isn't defined yet
############################################

macro( copy_python_aux_files mod_path )
file( GLOB PYTHON_AUX_FILES "${CMAKE_CURRENT_SOURCE_DIR}/misc/${mod_path}/*.py" )
file( COPY ${PYTHON_AUX_FILES} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/${mod_path}" )
endmacro()

############################################

configure_file(
Expand All @@ -95,13 +105,17 @@ configure_file(
@ONLY
)

file( GLOB PYTHON_AUX_FILES "${CMAKE_CURRENT_SOURCE_DIR}/misc/libcarna/*.py" )
file( COPY ${PYTHON_AUX_FILES} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/${PYTHON_MODULE_NAME}" )
copy_python_aux_files( "${PYTHON_MODULE_NAME}" )
copy_python_aux_files( "${PYTHON_MODULE_NAME}/libs" )
copy_python_aux_files( "${PYTHON_MODULE_NAME}/libs/skvideo" )
copy_python_aux_files( "${PYTHON_MODULE_NAME}/libs/skvideo/io" )
copy_python_aux_files( "${PYTHON_MODULE_NAME}/libs/skvideo/utils" )

file( GLOB LICENSES "${LibCarna_LICENSE_DIR}/LICENSE*" )
file( COPY ${LICENSES} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" )
file( COPY ${CMAKE_CURRENT_SOURCE_DIR}/README.md DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" )
file( COPY ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" )
file( COPY ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE-skvideo DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" )

############################################
# Project
Expand Down
32 changes: 32 additions & 0 deletions LICENSE-skvideo
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
New BSD License

Copyright (c) 2015 The scikit-video developers.
All rights reserved.


Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

a. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
b. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
c. Neither the name of the scikit-video developers nor the names of
its contributors may be used to endorse or promote products
derived from this software without specific prior written
permission.


THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.

1 change: 0 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dependencies:
- libcarna ==3.4.0
- matplotlib-base # for `_colormap_helper`
- numpngw ==0.1.4 # writes APNG
- scikit-video ==1.1.11 # API for ffmpeg
- ffmpeg # writes h264
- scipy # for `libcarna.data` and `libcarna.normalize_hounsfield_units`
- scikit-image # for `libcarna.data`
Expand Down
110 changes: 55 additions & 55 deletions examples/cells.ipynb

Large diffs are not rendered by default.

68 changes: 34 additions & 34 deletions examples/cthead.ipynb

Large diffs are not rendered by default.

70 changes: 35 additions & 35 deletions examples/introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"id": "3bf7058d",
"metadata": {
"execution": {
"iopub.execute_input": "2025-05-13T11:30:37.159368Z",
"iopub.status.busy": "2025-05-13T11:30:37.159210Z",
"iopub.status.idle": "2025-05-13T11:30:37.733839Z",
"shell.execute_reply": "2025-05-13T11:30:37.733418Z"
"iopub.execute_input": "2025-05-15T21:27:31.292087Z",
"iopub.status.busy": "2025-05-15T21:27:31.291928Z",
"iopub.status.idle": "2025-05-15T21:27:31.692969Z",
"shell.execute_reply": "2025-05-15T21:27:31.692413Z"
},
"vscode": {
"languageId": "plaintext"
Expand Down Expand Up @@ -52,10 +52,10 @@
"id": "cd38b675",
"metadata": {
"execution": {
"iopub.execute_input": "2025-05-13T11:30:37.735613Z",
"iopub.status.busy": "2025-05-13T11:30:37.735453Z",
"iopub.status.idle": "2025-05-13T11:30:37.737396Z",
"shell.execute_reply": "2025-05-13T11:30:37.737148Z"
"iopub.execute_input": "2025-05-15T21:27:31.694352Z",
"iopub.status.busy": "2025-05-15T21:27:31.694173Z",
"iopub.status.idle": "2025-05-15T21:27:31.696537Z",
"shell.execute_reply": "2025-05-15T21:27:31.696148Z"
},
"vscode": {
"languageId": "plaintext"
Expand Down Expand Up @@ -84,10 +84,10 @@
"id": "8518d1b2",
"metadata": {
"execution": {
"iopub.execute_input": "2025-05-13T11:30:37.738879Z",
"iopub.status.busy": "2025-05-13T11:30:37.738781Z",
"iopub.status.idle": "2025-05-13T11:30:37.740641Z",
"shell.execute_reply": "2025-05-13T11:30:37.740403Z"
"iopub.execute_input": "2025-05-15T21:27:31.697706Z",
"iopub.status.busy": "2025-05-15T21:27:31.697602Z",
"iopub.status.idle": "2025-05-15T21:27:31.699966Z",
"shell.execute_reply": "2025-05-15T21:27:31.699586Z"
},
"vscode": {
"languageId": "plaintext"
Expand Down Expand Up @@ -120,10 +120,10 @@
"id": "df9403bf",
"metadata": {
"execution": {
"iopub.execute_input": "2025-05-13T11:30:37.742124Z",
"iopub.status.busy": "2025-05-13T11:30:37.742021Z",
"iopub.status.idle": "2025-05-13T11:30:37.746048Z",
"shell.execute_reply": "2025-05-13T11:30:37.745798Z"
"iopub.execute_input": "2025-05-15T21:27:31.701092Z",
"iopub.status.busy": "2025-05-15T21:27:31.700980Z",
"iopub.status.idle": "2025-05-15T21:27:31.705588Z",
"shell.execute_reply": "2025-05-15T21:27:31.705204Z"
},
"vscode": {
"languageId": "plaintext"
Expand All @@ -133,7 +133,7 @@
{
"data": {
"text/plain": [
"<libcarna._spatial.geometry.<locals>.Geometry at 0x7c02b5141eb0>"
"<libcarna._spatial.geometry.<locals>.Geometry at 0x79040f1b1df0>"
]
},
"execution_count": 4,
Expand Down Expand Up @@ -182,10 +182,10 @@
"id": "4a1a1c31",
"metadata": {
"execution": {
"iopub.execute_input": "2025-05-13T11:30:37.747577Z",
"iopub.status.busy": "2025-05-13T11:30:37.747480Z",
"iopub.status.idle": "2025-05-13T11:30:37.749306Z",
"shell.execute_reply": "2025-05-13T11:30:37.749077Z"
"iopub.execute_input": "2025-05-15T21:27:31.706696Z",
"iopub.status.busy": "2025-05-15T21:27:31.706593Z",
"iopub.status.idle": "2025-05-15T21:27:31.708834Z",
"shell.execute_reply": "2025-05-15T21:27:31.708452Z"
},
"vscode": {
"languageId": "plaintext"
Expand Down Expand Up @@ -221,10 +221,10 @@
"id": "0ca491a8",
"metadata": {
"execution": {
"iopub.execute_input": "2025-05-13T11:30:37.750878Z",
"iopub.status.busy": "2025-05-13T11:30:37.750675Z",
"iopub.status.idle": "2025-05-13T11:30:37.833847Z",
"shell.execute_reply": "2025-05-13T11:30:37.833433Z"
"iopub.execute_input": "2025-05-15T21:27:31.709922Z",
"iopub.status.busy": "2025-05-15T21:27:31.709820Z",
"iopub.status.idle": "2025-05-15T21:27:31.782437Z",
"shell.execute_reply": "2025-05-15T21:27:31.782093Z"
},
"vscode": {
"languageId": "plaintext"
Expand Down Expand Up @@ -253,10 +253,10 @@
"id": "37ff9c22",
"metadata": {
"execution": {
"iopub.execute_input": "2025-05-13T11:30:37.835247Z",
"iopub.status.busy": "2025-05-13T11:30:37.835139Z",
"iopub.status.idle": "2025-05-13T11:30:37.931324Z",
"shell.execute_reply": "2025-05-13T11:30:37.930910Z"
"iopub.execute_input": "2025-05-15T21:27:31.783596Z",
"iopub.status.busy": "2025-05-15T21:27:31.783489Z",
"iopub.status.idle": "2025-05-15T21:27:31.876948Z",
"shell.execute_reply": "2025-05-15T21:27:31.876528Z"
},
"vscode": {
"languageId": "plaintext"
Expand All @@ -266,7 +266,7 @@
{
"data": {
"text/plain": [
"<matplotlib.image.AxesImage at 0x7c02b4fff890>"
"<matplotlib.image.AxesImage at 0x79040f09c050>"
]
},
"execution_count": 7,
Expand Down Expand Up @@ -307,10 +307,10 @@
"id": "10ab7a0a",
"metadata": {
"execution": {
"iopub.execute_input": "2025-05-13T11:30:37.932674Z",
"iopub.status.busy": "2025-05-13T11:30:37.932571Z",
"iopub.status.idle": "2025-05-13T11:30:38.079719Z",
"shell.execute_reply": "2025-05-13T11:30:38.079276Z"
"iopub.execute_input": "2025-05-15T21:27:31.878180Z",
"iopub.status.busy": "2025-05-15T21:27:31.878061Z",
"iopub.status.idle": "2025-05-15T21:27:32.032392Z",
"shell.execute_reply": "2025-05-15T21:27:32.031942Z"
},
"vscode": {
"languageId": "plaintext"
Expand Down Expand Up @@ -373,7 +373,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.10"
"version": "3.13.3"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions misc/libcarna/_imshow.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import numpngw
import numpy as np
import skvideo.io
from .libs.skvideo import io as skvideo_io

try:
from IPython.core.display import HTML as IPythonHTML
Expand Down Expand Up @@ -47,7 +47,7 @@ def _render_html_h264(array: np.ndarray | Iterable[np.ndarray], fps: float = 25)

# Encode video
with tempfile.NamedTemporaryFile(suffix='.mp4') as mp4_file:
with skvideo.io.FFmpegWriter(
with skvideo_io.FFmpegWriter(
mp4_file.name,
outputdict={
'-vcodec': 'h264',
Expand Down
Empty file added misc/libcarna/libs/__init__.py
Empty file.
Loading
Loading