Skip to content
Draft
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
32 changes: 28 additions & 4 deletions .github/presets/linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,34 @@
"CMAKE_C_COMPILER_LAUNCHER": "ccache",
"CMAKE_CXX_COMPILER_LAUNCHER": "ccache",

"IVW_MODULE_FFMPEG": "OFF",
"IVW_MODULE_WEBBROWSER": "OFF",
"IVW_MODULE_WEBQT": "OFF",
"IVW_TEST_BENCHMARKS": "OFF"
"IVW_EXTERNAL_MODULES" : "${sourceParentDir}/modules/misc;${sourceParentDir}/modules/medvis;${sourceParentDir}/modules/molvis;${sourceParentDir}/modules/tensorvis;${sourceParentDir}/modules/topovis;${sourceParentDir}/modules/vectorvis;${sourceParentDir}/modules/infravis",

"IVW_TEST_BENCHMARKS": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_ASTROPHYSICS": { "type": "BOOL", "value": "ON" },
"IVW_MODULE_FFMPEG": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_WEBBROWSER": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_WEBQT": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_VTK": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_COMPUTESHADEREXAMPLES": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_DEVTOOLS": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_GRAPHVIZ": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_OPENMESH": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_SPRINGSYSTEM": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_VASP": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_GAUSSIAN": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_NANOVGUTILS": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_TENSORVISBASE": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_TENSORVISIO": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_TENSORVISPYTHON": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_INTEGRALLINEFILTERING": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_MOLVISBASE": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_MOLVISGL": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_MOLVISPYTHON": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_DATAFRAMECLUSTERING": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_C3D": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_TTK": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_OPACTOPT": { "type": "BOOL", "value": "OFF" },
"IVW_MODULE_PYTHONTOOLS": { "type": "BOOL", "value": "OFF" }
}
},
{
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Additional Inviwo modules grouped into different categories. To enable the modul
* IntegralLineFiltering: Provides functionality to convert a `IntegralLineSet` to `DataFrame` containing various metrics of the lines that can be used together with the plotting functionality in the `Plotting` and `PlottingGL` modules in core. See example workspace on how to use it.

## infovis - Information Visualization

## infravis - various modules

* AstroPhysics: primarily Python-based processors dealing with ALMA data in the FITS data format

## medvis - Medical Visualization

* DICOM: functionality for loading and writing DICOM files using the Grassroots DICOM ([GDCM](https://sourceforge.net/projects/gdcm/))
Expand Down
46 changes: 46 additions & 0 deletions infravis/astrophysics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
ivw_module(AstroPhysics)

set(HEADER_FILES
include/infravis/astrophysics/astrophysicsmodule.h
include/infravis/astrophysics/astrophysicsmoduledefine.h
include/infravis/astrophysics/processors/fitsvolumeraycaster.h
include/infravis/astrophysics/shadercomponents/fitsnonlineardepthcomponent.h
)
ivw_group("Header Files" ${HEADER_FILES})

set(SOURCE_FILES
src/astrophysicsmodule.cpp
src/processors/fitsvolumeraycaster.cpp
src/shadercomponents/fitsnonlineardepthcomponent.cpp
)
ivw_group("Source Files" ${SOURCE_FILES})

set(PYTHON_FILES
python/astroviscommon.py
python/ivwastrovis.py
python/processors/AngleToVector2D.py
python/processors/AxisSliceAnnotation.py
python/processors/FitsDepthCorrection.py
python/processors/FitsPolarizationSource.py
python/processors/FitsVolumeSource.py
)
ivw_group("Python Files" ${PYTHON_FILES})

set(SHADER_FILES
# Add shaders
)
ivw_group("Shader Files" ${SHADER_FILES})

set(TEST_FILES
tests/unittests/astrophysics-unittest-main.cpp
)
ivw_add_unittest(${TEST_FILES})

ivw_create_module(${SOURCE_FILES} ${HEADER_FILES} ${SHADER_FILES} ${PYTHON_FILES})

ivw_add_to_module_pack(${CMAKE_CURRENT_SOURCE_DIR}/python)

set_property(GLOBAL APPEND PROPERTY IVW_PYTHON_ADDITIONAL_MODULES astropy)

# Add shader directory to install package
#ivw_add_to_module_pack(${CMAKE_CURRENT_SOURCE_DIR}/glsl)
21 changes: 21 additions & 0 deletions infravis/astrophysics/depends.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Inviwo module dependencies for current module
# List modules on the format "Inviwo<ModuleName>Module"
set(dependencies
InviwoOpenGLModule
InviwoBaseGLModule
InviwoPython3Module
)

# Add an alias for this module. Several modules can share an alias.
# Useful if several modules implement the same functionality.
# A depending module can depend on the alias, and a drop down of
# available implementations will be presented in CMake
#set(aliases ModuleAlias)

# Mark the module as protected to prevent it from being reloaded
# when using runtime module reloading.
#set(protected ON)

# By calling set(EnableByDefault ON) the module will be set to enabled
# when initially being added to CMake. Default OFF.
set(EnableByDefault ON)
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*********************************************************************************
*
* Inviwo - Interactive Visualization Workshop
*
* Copyright (c) 2026 Inviwo Foundation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. 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.
*
* 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 COPYRIGHT OWNER 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.
*
*********************************************************************************/
#pragma once

#include <infravis/astrophysics/astrophysicsmoduledefine.h>
#include <inviwo/core/common/inviwomodule.h>
#include <modules/python3/pythonprocessorfolderobserver.h>
#include <modules/python3/pyutils.h>

namespace inviwo {

class IVW_MODULE_ASTROPHYSICS_API AstroPhysicsModule : public InviwoModule {
public:
explicit AstroPhysicsModule(InviwoApplication* app);

pyutil::ModulePath scripts_;
PythonProcessorFolderObserver pythonFolderObserver_;
};

} // namespace inviwo
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#pragma once

// clang-format off
#ifdef INVIWO_ALL_DYN_LINK //DYNAMIC
// If we are building DLL files we must declare dllexport/dllimport
#ifdef IVW_MODULE_ASTROPHYSICS_EXPORTS
#ifdef _WIN32
#define IVW_MODULE_ASTROPHYSICS_API __declspec(dllexport)
#else //UNIX (GCC)
#define IVW_MODULE_ASTROPHYSICS_API __attribute__ ((visibility ("default")))
#endif
#else
#ifdef _WIN32
#define IVW_MODULE_ASTROPHYSICS_API __declspec(dllimport)
#else
#define IVW_MODULE_ASTROPHYSICS_API
#endif
#endif
#else //STATIC
#define IVW_MODULE_ASTROPHYSICS_API
#endif
// clang-format on
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*********************************************************************************
*
* Inviwo - Interactive Visualization Workshop
*
* Copyright (c) 2026 Inviwo Foundation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. 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.
*
* 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 COPYRIGHT OWNER 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.
*
*********************************************************************************/

#pragma once

#include <infravis/astrophysics/astrophysicsmoduledefine.h>

#include <modules/basegl/processors/raycasting/volumeraycasterbase.h>
#include <modules/basegl/shadercomponents/backgroundcomponent.h>
#include <modules/basegl/shadercomponents/cameracomponent.h>
#include <modules/basegl/shadercomponents/entryexitcomponent.h>
#include <modules/basegl/shadercomponents/isotfcomponent.h>
#include <modules/basegl/shadercomponents/lightcomponent.h>
#include <modules/basegl/shadercomponents/raycastingcomponent.h>
#include <modules/basegl/shadercomponents/volumecomponent.h>

#include <infravis/astrophysics/shadercomponents/fitsnonlineardepthcomponent.h>

namespace inviwo {

class IVW_MODULE_ASTROPHYSICS_API FitsVolumeRaycaster : public VolumeRaycasterBase {
public:
explicit FitsVolumeRaycaster(std::string_view identifier = {},
std::string_view displayName = {});

virtual void process() override;

virtual const ProcessorInfo& getProcessorInfo() const override;
static const ProcessorInfo processorInfo_;

private:
FitsNonlinearDepthComponent fits_;
EntryExitComponent entryExit_;
BackgroundComponent background_;
IsoTFComponent<1> isoTF_;
RaycastingComponent raycasting_;
CameraComponent camera_;
LightComponent light_;
};

} // namespace inviwo
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*********************************************************************************
*
* Inviwo - Interactive Visualization Workshop
*
* Copyright (c) 2026 Inviwo Foundation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. 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.
*
* 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 COPYRIGHT OWNER 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.
*
*********************************************************************************/
#pragma once

#include <infravis/astrophysics/astrophysicsmoduledefine.h>

#include <inviwo/core/ports/volumeport.h>
#include <inviwo/core/properties/stringproperty.h>
#include <inviwo/core/properties/compositeproperty.h>
#include <inviwo/core/properties/ordinalproperty.h>
#include <modules/basegl/shadercomponents/shadercomponent.h>

namespace inviwo {

class Inport;
class Property;
class Shader;
class TextureUnitContainer;

class IVW_MODULE_ASTROPHYSICS_API FitsNonlinearDepthComponent : public ShaderComponent {
public:
explicit FitsNonlinearDepthComponent(std::string_view volume, Document help = {});

virtual std::string_view getName() const override;
virtual void process(Shader& shader, TextureUnitContainer&) override;
virtual void initializeResources(Shader& shader) override;
virtual std::vector<std::tuple<Inport*, std::string>> getInports() override;
virtual std::vector<Property*> getProperties() override;

virtual std::vector<Segment> getSegments() override;

std::optional<size_t> channelsForVolume() const;

VolumeInport volumePort_;

private:
CompositeProperty fitsParameters_;
StringProperty objectName_;
FloatProperty assumedDistance_;
FloatProperty velocityInf_;
FloatProperty velocityStar_;
FloatProperty crpix3_;
FloatProperty crval3_;
FloatProperty cdelt3_;
FloatProperty restFrequency_;
FloatVec3Property dataExtent_;
FloatVec3Property dataOffset_;
IntVec2Property validChannelRange_;
FloatVec3Property invalidColor_;
FloatProperty invalidAlpha_;
};

} // namespace inviwo
Loading
Loading