├── README.md ├── VolViewer.nsi ├── VolViewer.sln ├── VolViewer ├── .gitattributes ├── .gitignore ├── Examples │ ├── example1.bat │ ├── example2.bat │ ├── example3.bat │ ├── example4.bat │ └── example5.bat ├── Icons │ ├── 3D.png │ ├── A_AND_B.png │ ├── A_DIFF_B.png │ ├── A_NOT_B.png │ ├── BB.png │ ├── B_NOT_A.png │ ├── FS.png │ ├── HQ.png │ ├── I.png │ ├── L.png │ ├── LQ.png │ ├── MQ.png │ ├── OME.png │ ├── VideoCamera.png │ ├── a.png │ ├── about.png │ ├── add.png │ ├── bg.png │ ├── big.psd │ ├── biooptonics_logo.png │ ├── blue.png │ ├── bookmarks.png │ ├── c.png │ ├── camera.png │ ├── config.png │ ├── crop.png │ ├── crop0.png │ ├── crop1.png │ ├── cut.png │ ├── empty.png │ ├── excel.png │ ├── facebuilder.png │ ├── fileopen.xpm │ ├── filesave.xpm │ ├── filter.png │ ├── fps.png │ ├── function.png │ ├── green.png │ ├── info.png │ ├── iso.png │ ├── labeller.png │ ├── light.png │ ├── lights.png │ ├── lineloop.png │ ├── lines.png │ ├── linesegment.png │ ├── load.png │ ├── logo.png │ ├── logo_start.png │ ├── magneticlines.png │ ├── mip.png │ ├── move.png │ ├── movie.png │ ├── movie2.png │ ├── mrct_logo.png │ ├── onoff.png │ ├── points.png │ ├── quality.png │ ├── rec.png │ ├── red.png │ ├── remove.png │ ├── ruler.png │ ├── s.png │ ├── save.png │ ├── scalebar.png │ ├── screenshot3.png │ ├── sectioncursor.png │ ├── sectioninvert.png │ ├── slice.png │ ├── small.psd │ ├── spanner.png │ ├── splash.png │ ├── surface.png │ ├── transfer.png │ ├── trianglesheet.png │ ├── view.png │ ├── zoomin.png │ ├── zoomout.png │ └── zoomreset.png ├── Kernels │ ├── anisotropic.cl │ ├── bilateral.cl │ ├── boundingbox.cl │ ├── dilate.cl │ ├── erode.cl │ ├── gaussian.cl │ ├── kernel_.cl │ ├── median.cl │ ├── median_shared.cl │ └── reduction.cl ├── Shaders │ ├── Copy of volume_allchannelsLAMBERTIAN.frag │ ├── Copy of volume_allchannelsLAMBERTIAN.vert │ ├── celshading.frag │ ├── celshading.vert │ ├── perfragment.frag │ ├── perfragment.vert │ ├── ssao.frag │ ├── ssao.vert │ ├── unsharp.frag │ ├── unsharp.vert │ ├── vol2d.frag │ ├── vol2d.vert │ ├── vol2dtrilin.frag │ ├── vol2dtrilin.vert │ ├── volume_allchannelsBLING-PHONG.frag │ ├── volume_allchannelsBLING-PHONG.vert │ ├── volume_allchannelsBLING-PHONG2SP.frag │ ├── volume_allchannelsBLING-PHONG2SP.vert │ ├── volume_allchannelsBLING-PHONG_CT.frag │ ├── volume_allchannelsBLING-PHONG_CT.vert │ ├── volume_allchannelsCLIP.frag │ ├── volume_allchannelsCLIP.vert │ ├── volume_allchannelsDEPTH.frag │ ├── volume_allchannelsDEPTH.vert │ ├── volume_allchannelsGOOCH.frag │ ├── volume_allchannelsGOOCH.vert │ ├── volume_allchannelsLAMBERTIAN.frag │ ├── volume_allchannelsLAMBERTIAN.vert │ ├── volume_allchannelsNOLIGHT.frag │ ├── volume_allchannelsNOLIGHT.vert │ ├── volume_allchannelsSEM.frag │ ├── volume_allchannelsSEM.vert │ ├── volume_allchannelsSINGPASS_NOLIGHT.frag │ ├── volume_allchannelsSINGPASS_NOLIGHT.vert │ ├── volume_allchannelsXRAY.frag │ ├── volume_allchannelsXRAY.vert │ ├── volume_sections.frag │ ├── volume_sections.vert │ ├── volume_singlechannelNOLIGHT.frag │ ├── volume_singlechannelNOLIGHT.vert │ ├── xray.frag │ └── xray.vert ├── VolViewer.qrc ├── VolViewer.vcproj ├── VolViewer.vcxproj ├── VolViewer.vcxproj.filters ├── settings.ini └── src │ ├── ArcBall.cpp │ ├── ArcBall.h │ ├── BSpline.cpp │ ├── BSpline.h │ ├── CVector.cpp │ ├── CVector.h │ ├── Camera.cpp │ ├── Camera.h │ ├── ColourFun.cpp │ ├── ColourFun.h │ ├── ColourMap.cpp │ ├── ColourMap.h │ ├── Constant.h │ ├── DatasetView.cpp │ ├── DatasetView.h │ ├── Edge.h │ ├── Face.cpp │ ├── Face.h │ ├── Filter.cpp │ ├── Filter.h │ ├── FilterDefinitions.h │ ├── Floodfill.cpp │ ├── Floodfill.h │ ├── FunctionEditor.cpp │ ├── FunctionEditor.h │ ├── GL_Ext.cpp │ ├── GL_Ext.h │ ├── GL_FrameBufferObject.cpp │ ├── GL_FrameBufferObject.h │ ├── GL_ShaderObj.cpp │ ├── GL_ShaderObj.h │ ├── Gaussian.cpp │ ├── Gaussian.h │ ├── Global.cpp │ ├── Global.h │ ├── LICENSE.txt │ ├── LICENSE.url.URL │ ├── Main.cpp │ ├── MarchingCubes.cpp │ ├── MarchingCubes.h │ ├── MarchingCubesLookupTab.h │ ├── Matrix.cpp │ ├── Matrix.h │ ├── Matrix4x4.cpp │ ├── Matrix4x4.h │ ├── MaxFlowSegmentation.cpp │ ├── MaxFlowSegmentation.h │ ├── MeasureDefinitions.h │ ├── MeasureListObject.cpp │ ├── MeasureListObject.h │ ├── MeasureObject.cpp │ ├── MeasureObject.h │ ├── Mesh.cpp │ ├── Mesh.h │ ├── MeshListObject.cpp │ ├── MeshListObject.h │ ├── MyDefines.h │ ├── MyMath.cpp │ ├── MyMath.h │ ├── OMEROLoader.cpp │ ├── OMEROLoader.h │ ├── OpenCLExecuter.cpp │ ├── OpenCLExecuter.h │ ├── OpenCLWrapper.cpp │ ├── OpenCLWrapper.h │ ├── PCA.cpp │ ├── PCA.h │ ├── PeronaMalikFlow.cpp │ ├── PeronaMalikFlow.h │ ├── PlaneWidget.cpp │ ├── PlaneWidget.h │ ├── PlaneWidgetInCube.cpp │ ├── PlaneWidgetInCube.h │ ├── Point3D.h │ ├── QtCLippingWidget.cpp │ ├── QtCLippingWidget.h │ ├── QtCameraEditorDialogue.cpp │ ├── QtCameraEditorDialogue.h │ ├── QtCameraSettingsWidget.cpp │ ├── QtCameraSettingsWidget.h │ ├── QtClippingEditorDialogue.cpp │ ├── QtClippingEditorDialogue.h │ ├── QtCropEditorDialogue.cpp │ ├── QtCropEditorDialogue.h │ ├── QtCropWidget.cpp │ ├── QtCropWidget.h │ ├── QtDatasetViewDialogue.cpp │ ├── QtDatasetViewDialogue.h │ ├── QtDatasetViewWidget.cpp │ ├── QtDatasetViewWidget.h │ ├── QtFilterEditorDialogue.cpp │ ├── QtFilterEditorDialogue.h │ ├── QtFilterWidget.cpp │ ├── QtFilterWidget.h │ ├── QtGLObjWin.cpp │ ├── QtGLObjWin.h │ ├── QtGLWidget.cpp │ ├── QtGLWidget.h │ ├── QtHistoTfuncPixmap.cpp │ ├── QtHistoTfuncPixmap.h │ ├── QtHistogram.cpp │ ├── QtHistogram.h │ ├── QtIsoSurfaceWidget.cpp │ ├── QtIsoSurfaceWidget.h │ ├── QtLightEditorDialogue.cpp │ ├── QtLightEditorDialogue.h │ ├── QtLightSettingsWidget.cpp │ ├── QtLightSettingsWidget.h │ ├── QtMainWindow.cpp │ ├── QtMainWindow.h │ ├── QtMeasuringEditorDialogue.cpp │ ├── QtMeasuringEditorDialogue.h │ ├── QtMeasuringWidget.cpp │ ├── QtMeasuringWidget.h │ ├── QtMovieEditorDialogue.cpp │ ├── QtMovieEditorDialogue.h │ ├── QtMoviePlayer.cpp │ ├── QtMoviePlayer.h │ ├── QtMovieSettingsWidget.cpp │ ├── QtMovieSettingsWidget.h │ ├── QtOMEROLoader.cpp │ ├── QtOMEROLoader.h │ ├── QtRenderSettingsWidget.cpp │ ├── QtRenderSettingsWidget.h │ ├── QtRenderViewDialogue.cpp │ ├── QtRenderViewDialogue.h │ ├── QtRenderViewWidget.cpp │ ├── QtRenderViewWidget.h │ ├── QtSliceFrame.cpp │ ├── QtSliceFrame.h │ ├── QtSplashScreen.cpp │ ├── QtSplashScreen.h │ ├── QtStereoEditorDialogue.cpp │ ├── QtStereoEditorDialogue.h │ ├── QtStereoSettingsWidget.cpp │ ├── QtStereoSettingsWidget.h │ ├── QtThreadedBrickLoader.cpp │ ├── QtThreadedBrickLoader.h │ ├── QtThreadedSliceLoader.cpp │ ├── QtThreadedSliceLoader.h │ ├── QtTransferFuncDialogue.cpp │ ├── QtTransferFuncDialogue.h │ ├── QtTransferFuncWidget.cpp │ ├── QtTransferFuncWidget.h │ ├── QtTransferFunctionEditorDialogue.cpp │ ├── QtTransferFunctionEditorDialogue.h │ ├── QtTransferFunctionWidget.cpp │ ├── QtTransferFunctionWidget.h │ ├── QtTransformEditorDialogue.cpp │ ├── QtTransformEditorDialogue.h │ ├── QtTransformWidget.cpp │ ├── QtTransformWidget.h │ ├── QtViewEditorDialogue.cpp │ ├── QtViewEditorDialogue.h │ ├── QtViewSettingsWidget.cpp │ ├── QtViewSettingsWidget.h │ ├── QtVolumeEditorDialogue.cpp │ ├── QtVolumeEditorDialogue.h │ ├── Quaternion.cpp │ ├── Quaternion.h │ ├── RAW.cpp │ ├── RAW.h │ ├── SVNObject.cpp │ ├── SVNObject.h │ ├── ShaderDefinitions.h │ ├── Sieve.cpp │ ├── Sieve.h │ ├── Sobel.cpp │ ├── Sobel.h │ ├── TfuncState.cpp │ ├── TfuncState.h │ ├── Timer.cpp │ ├── Timer.h │ ├── Tokenizer.cpp │ ├── Tokenizer.h │ ├── Triangulate.cpp │ ├── Triangulate.h │ ├── Vector.cpp │ ├── Vector.h │ ├── VolIO.cpp │ ├── VolIO.h │ ├── VolViewer.ico │ ├── VolViewer.rc │ ├── VolViewer.res │ ├── VolumeObject.cpp │ ├── VolumeObject.h │ ├── VolumeRender.cpp │ ├── VolumeRender.h │ ├── VolumeRenderView.cpp │ ├── VolumeRenderView.h │ ├── VolumeScript.cpp │ ├── VolumeScript.h │ ├── build_linux.sh │ ├── build_mac.sh │ ├── build_win.bat │ ├── gl.h │ ├── glext.h │ ├── libtiff │ ├── src │ │ └── tiff-3.9.5.zip │ ├── t4.h │ ├── tif_config.h │ ├── tif_config.vc.h │ ├── tif_config.wince.h │ ├── tif_dir.h │ ├── tif_fax3.h │ ├── tif_predict.h │ ├── tiff.h │ ├── tiffconf.h │ ├── tiffconf.vc.h │ ├── tiffconf.wince.h │ ├── tiffio.h │ ├── tiffiop.h │ ├── tiffvers.h │ └── uvcode.h │ ├── macosx_build.sh │ ├── maxflow.cpp │ ├── maxflow_block.h │ ├── maxflow_graph.cpp │ ├── maxflow_graph.h │ ├── maxflow_instances.inc │ ├── resource.h │ └── src.pro ├── VolViewer2.sln ├── VolViewer32bit.nsi └── VolViewer64bit.nsi /README.md: -------------------------------------------------------------------------------- 1 | VolViewer 2 | ========= 3 | 4 | A cross platform volume rendering and processing application. (PhD project) 5 | 6 | - Final resting place for my PhD work 7 | - Comes as is, in hope to help others 8 | 9 | For more information please visit: www.volviewer.org 10 | 11 | For a publication created as a result of my PHD: http://rico-coen.jic.ac.uk/uploads/f/fe/Lee_Plant_Cell.pdf 12 | -------------------------------------------------------------------------------- /VolViewer.nsi: -------------------------------------------------------------------------------- 1 | ; VolViewerInstaller.nsi 2 | ; 3 | ; Nullsoft Scriptable Install System 4 | ; 5 | ; Custom script for the VolViewer Application 6 | ; author: Jerome Avondo 7 | ;-------------------------------- 8 | 9 | ; The name of the installer 10 | Name "VolViewer" 11 | 12 | ; The file to write 13 | OutFile "VolViewerInstaller.exe" 14 | 15 | ; The default installation directory 16 | InstallDir $PROGRAMFILES\VolViewer 17 | 18 | ; The text to prompt the user to enter a directory 19 | DirText "This will install the VolViewer application on your computer. Please choose a directory" 20 | 21 | ;-------------------------------- 22 | 23 | ; The stuff to install 24 | Section "" ;No components page, name is not important 25 | 26 | ; Set output path to the installation directory. 27 | ; Put file there 28 | SetOutPath $INSTDIR 29 | File VolViewer\VolViewer.exe 30 | File VolViewer\Qt3Support4.dll 31 | File VolViewer\QtCore4.dll 32 | File VolViewer\QtGui4.dll 33 | File VolViewer\QtNetwork4.dll 34 | File VolViewer\QtOpenGL4.dll 35 | File VolViewer\QtScript4.dll 36 | File VolViewer\QtScriptTools4.dll 37 | File VolViewer\QtSql4.dll 38 | File VolViewer\QtSvg4.dll 39 | File VolViewer\QtXml4.dll 40 | File VolViewer\QtXmlPatterns4.dll 41 | File VolViewer\settings.ini 42 | SetOutPath $INSTDIR\imageformats 43 | File VolViewer\imageformats\*.* 44 | SetOutPath $INSTDIR\Icons 45 | File VolViewer\Icons\*.* 46 | SetOutPath $INSTDIR\Shaders 47 | File VolViewer\Shaders\*.* 48 | SetOutPath $INSTDIR 49 | 50 | ; Now create shortcuts 51 | CreateDirectory "$SMPROGRAMS\VolViewer" 52 | CreateShortCut "$SMPROGRAMS\VolViewer\VolViewer.lnk" "$INSTDIR\VolViewer.exe" 53 | CreateShortCut "$SMPROGRAMS\VolViewer\Edit Settings.lnk" "$INSTDIR\Settings.ini" 54 | CreateShortCut "$SMPROGRAMS\VolViewer\Uninstall.lnk" "$INSTDIR\Uninstall.exe" 55 | CreateShortCut "$DESKTOP\VolViewer.lnk" "$INSTDIR\VolViewer.exe" 56 | 57 | ; Tell the compiler to write an uninstaller and to look for a "Uninstall" section 58 | WriteUninstaller $INSTDIR\Uninstall.exe 59 | 60 | SectionEnd ; end the section 61 | 62 | ; The uninstall section 63 | Section "Uninstall" 64 | 65 | ; Delete the files and folders 66 | Delete $INSTDIR\*.* 67 | Delete $INSTDIR\Icons\*.* 68 | Delete $INSTDIR\Shaders\*.* 69 | Delete $INSTDIR\imageformats\*.* 70 | RMDir $INSTDIR\Icons 71 | RMDir $INSTDIR\Shaders 72 | RMDir $INSTDIR\imageformats 73 | RMDir $INSTDIR 74 | 75 | ;Now remove shortcuts too 76 | Delete "$SMPROGRAMS\VolViewer\Uninstall.lnk" 77 | Delete "$SMPROGRAMS\VolViewer\Edit Settings.lnk" 78 | Delete "$SMPROGRAMS\VolViewer\VolViewer.lnk" 79 | RMDir "$SMPROGRAMS\VolViewer" 80 | Delete "$DESKTOP\VolViewer.lnk" 81 | 82 | SectionEnd -------------------------------------------------------------------------------- /VolViewer.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VolViewer", "VolViewer\VolViewer.vcxproj", "{2096D454-8C4D-474E-B4DD-D085BB12E2EF}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug_OMERO|Win32 = Debug_OMERO|Win32 9 | Debug_OMERO|x64 = Debug_OMERO|x64 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Debug_OMERO|Win32.ActiveCfg = Debug_OMERO|Win32 17 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Debug_OMERO|Win32.Build.0 = Debug_OMERO|Win32 18 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Debug_OMERO|x64.ActiveCfg = Debug_OMERO|x64 19 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Debug_OMERO|x64.Build.0 = Debug_OMERO|x64 20 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Debug|Win32.ActiveCfg = Debug|Win32 21 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Debug|Win32.Build.0 = Debug|Win32 22 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Debug|x64.ActiveCfg = Debug|x64 23 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Debug|x64.Build.0 = Debug|x64 24 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Release|Win32.ActiveCfg = Release|Win32 25 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Release|Win32.Build.0 = Release|Win32 26 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Release|x64.ActiveCfg = Release|x64 27 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Release|x64.Build.0 = Release|x64 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /VolViewer/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /VolViewer/Examples/example1.bat: -------------------------------------------------------------------------------- 1 | BioptonicsViewer voldir="E:\-=VOLUME DATA=-\-=MEASURED=-\PD_T02" msr="E:\-=VOLUME DATA=-\-=MEASURED=-\PD_T02\cell.msr" tfunc="E:\-=VOLUME DATA=-\-=MEASURED=-\PD_T02\tfunc.tfn" slc="E:\-=VOLUME DATA=-\-=MEASURED=-\PD_T02\clipping.slc" -------------------------------------------------------------------------------- /VolViewer/Examples/example2.bat: -------------------------------------------------------------------------------- 1 | BioptonicsViewer omero_server="xxxxx" omero_username="xxxx" omero_password="xxxxx" omero_port=4063 omero_imageid=2408 2 | -------------------------------------------------------------------------------- /VolViewer/Examples/example3.bat: -------------------------------------------------------------------------------- 1 | BioptonicsViewer omero_server="xxxxx" omero_username="xxxxx" omero_password="xxxxx" omero_imageid=2452 -------------------------------------------------------------------------------- /VolViewer/Examples/example4.bat: -------------------------------------------------------------------------------- 1 | BioptonicsViewer omero_server="xxxx" omero_sessionid="xxxxx" omero_imageid=xxxx -------------------------------------------------------------------------------- /VolViewer/Examples/example5.bat: -------------------------------------------------------------------------------- 1 | VolViewer omero_watchfile="Watch.txt" -------------------------------------------------------------------------------- /VolViewer/Icons/3D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/3D.png -------------------------------------------------------------------------------- /VolViewer/Icons/A_AND_B.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/A_AND_B.png -------------------------------------------------------------------------------- /VolViewer/Icons/A_DIFF_B.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/A_DIFF_B.png -------------------------------------------------------------------------------- /VolViewer/Icons/A_NOT_B.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/A_NOT_B.png -------------------------------------------------------------------------------- /VolViewer/Icons/BB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/BB.png -------------------------------------------------------------------------------- /VolViewer/Icons/B_NOT_A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/B_NOT_A.png -------------------------------------------------------------------------------- /VolViewer/Icons/FS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/FS.png -------------------------------------------------------------------------------- /VolViewer/Icons/HQ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/HQ.png -------------------------------------------------------------------------------- /VolViewer/Icons/I.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/I.png -------------------------------------------------------------------------------- /VolViewer/Icons/L.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/L.png -------------------------------------------------------------------------------- /VolViewer/Icons/LQ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/LQ.png -------------------------------------------------------------------------------- /VolViewer/Icons/MQ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/MQ.png -------------------------------------------------------------------------------- /VolViewer/Icons/OME.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/OME.png -------------------------------------------------------------------------------- /VolViewer/Icons/VideoCamera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/VideoCamera.png -------------------------------------------------------------------------------- /VolViewer/Icons/a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/a.png -------------------------------------------------------------------------------- /VolViewer/Icons/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/about.png -------------------------------------------------------------------------------- /VolViewer/Icons/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/add.png -------------------------------------------------------------------------------- /VolViewer/Icons/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/bg.png -------------------------------------------------------------------------------- /VolViewer/Icons/big.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/big.psd -------------------------------------------------------------------------------- /VolViewer/Icons/biooptonics_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/biooptonics_logo.png -------------------------------------------------------------------------------- /VolViewer/Icons/blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/blue.png -------------------------------------------------------------------------------- /VolViewer/Icons/bookmarks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/bookmarks.png -------------------------------------------------------------------------------- /VolViewer/Icons/c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/c.png -------------------------------------------------------------------------------- /VolViewer/Icons/camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/camera.png -------------------------------------------------------------------------------- /VolViewer/Icons/config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/config.png -------------------------------------------------------------------------------- /VolViewer/Icons/crop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/crop.png -------------------------------------------------------------------------------- /VolViewer/Icons/crop0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/crop0.png -------------------------------------------------------------------------------- /VolViewer/Icons/crop1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/crop1.png -------------------------------------------------------------------------------- /VolViewer/Icons/cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/cut.png -------------------------------------------------------------------------------- /VolViewer/Icons/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/empty.png -------------------------------------------------------------------------------- /VolViewer/Icons/excel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/excel.png -------------------------------------------------------------------------------- /VolViewer/Icons/facebuilder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/facebuilder.png -------------------------------------------------------------------------------- /VolViewer/Icons/fileopen.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char *fileopen[] = { 3 | " 16 13 5 1", 4 | ". c #040404", 5 | "# c #808304", 6 | "a c None", 7 | "b c #f3f704", 8 | "c c #f3f7f3", 9 | "aaaaaaaaa...aaaa", 10 | "aaaaaaaa.aaa.a.a", 11 | "aaaaaaaaaaaaa..a", 12 | "a...aaaaaaaa...a", 13 | ".bcb.......aaaaa", 14 | ".cbcbcbcbc.aaaaa", 15 | ".bcbcbcbcb.aaaaa", 16 | ".cbcb...........", 17 | ".bcb.#########.a", 18 | ".cb.#########.aa", 19 | ".b.#########.aaa", 20 | "..#########.aaaa", 21 | "...........aaaaa" 22 | }; 23 | -------------------------------------------------------------------------------- /VolViewer/Icons/filesave.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char *filesave[] = { 3 | " 14 14 4 1", 4 | ". c #040404", 5 | "# c #808304", 6 | "a c #bfc2bf", 7 | "b c None", 8 | "..............", 9 | ".#.aaaaaaaa.a.", 10 | ".#.aaaaaaaa...", 11 | ".#.aaaaaaaa.#.", 12 | ".#.aaaaaaaa.#.", 13 | ".#.aaaaaaaa.#.", 14 | ".#.aaaaaaaa.#.", 15 | ".##........##.", 16 | ".############.", 17 | ".##.........#.", 18 | ".##......aa.#.", 19 | ".##......aa.#.", 20 | ".##......aa.#.", 21 | "b............." 22 | }; 23 | -------------------------------------------------------------------------------- /VolViewer/Icons/filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/filter.png -------------------------------------------------------------------------------- /VolViewer/Icons/fps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/fps.png -------------------------------------------------------------------------------- /VolViewer/Icons/function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/function.png -------------------------------------------------------------------------------- /VolViewer/Icons/green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/green.png -------------------------------------------------------------------------------- /VolViewer/Icons/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/info.png -------------------------------------------------------------------------------- /VolViewer/Icons/iso.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/iso.png -------------------------------------------------------------------------------- /VolViewer/Icons/labeller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/labeller.png -------------------------------------------------------------------------------- /VolViewer/Icons/light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/light.png -------------------------------------------------------------------------------- /VolViewer/Icons/lights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/lights.png -------------------------------------------------------------------------------- /VolViewer/Icons/lineloop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/lineloop.png -------------------------------------------------------------------------------- /VolViewer/Icons/lines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/lines.png -------------------------------------------------------------------------------- /VolViewer/Icons/linesegment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/linesegment.png -------------------------------------------------------------------------------- /VolViewer/Icons/load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/load.png -------------------------------------------------------------------------------- /VolViewer/Icons/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/logo.png -------------------------------------------------------------------------------- /VolViewer/Icons/logo_start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/logo_start.png -------------------------------------------------------------------------------- /VolViewer/Icons/magneticlines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/magneticlines.png -------------------------------------------------------------------------------- /VolViewer/Icons/mip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/mip.png -------------------------------------------------------------------------------- /VolViewer/Icons/move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/move.png -------------------------------------------------------------------------------- /VolViewer/Icons/movie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/movie.png -------------------------------------------------------------------------------- /VolViewer/Icons/movie2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/movie2.png -------------------------------------------------------------------------------- /VolViewer/Icons/mrct_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/mrct_logo.png -------------------------------------------------------------------------------- /VolViewer/Icons/onoff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/onoff.png -------------------------------------------------------------------------------- /VolViewer/Icons/points.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/points.png -------------------------------------------------------------------------------- /VolViewer/Icons/quality.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/quality.png -------------------------------------------------------------------------------- /VolViewer/Icons/rec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/rec.png -------------------------------------------------------------------------------- /VolViewer/Icons/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/red.png -------------------------------------------------------------------------------- /VolViewer/Icons/remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/remove.png -------------------------------------------------------------------------------- /VolViewer/Icons/ruler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/ruler.png -------------------------------------------------------------------------------- /VolViewer/Icons/s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/s.png -------------------------------------------------------------------------------- /VolViewer/Icons/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/save.png -------------------------------------------------------------------------------- /VolViewer/Icons/scalebar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/scalebar.png -------------------------------------------------------------------------------- /VolViewer/Icons/screenshot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/screenshot3.png -------------------------------------------------------------------------------- /VolViewer/Icons/sectioncursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/sectioncursor.png -------------------------------------------------------------------------------- /VolViewer/Icons/sectioninvert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/sectioninvert.png -------------------------------------------------------------------------------- /VolViewer/Icons/slice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/slice.png -------------------------------------------------------------------------------- /VolViewer/Icons/small.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/small.psd -------------------------------------------------------------------------------- /VolViewer/Icons/spanner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/spanner.png -------------------------------------------------------------------------------- /VolViewer/Icons/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/splash.png -------------------------------------------------------------------------------- /VolViewer/Icons/surface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/surface.png -------------------------------------------------------------------------------- /VolViewer/Icons/transfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/transfer.png -------------------------------------------------------------------------------- /VolViewer/Icons/trianglesheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/trianglesheet.png -------------------------------------------------------------------------------- /VolViewer/Icons/view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/view.png -------------------------------------------------------------------------------- /VolViewer/Icons/zoomin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/zoomin.png -------------------------------------------------------------------------------- /VolViewer/Icons/zoomout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/zoomout.png -------------------------------------------------------------------------------- /VolViewer/Icons/zoomreset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/Icons/zoomreset.png -------------------------------------------------------------------------------- /VolViewer/Kernels/bilateral.cl: -------------------------------------------------------------------------------- 1 | // ********************************************************************* 2 | // OpenCL Kernel Function for 3D Bi-lateral filter 3 | // ********************************************************************* 4 | __kernel void bilateral( __global unsigned char* src_buffer, __global unsigned char* dst_buffer, int sigma_spatial, float sigma_range, const int width, const int height, const int depth) 5 | { 6 | // get index into global data array 7 | int3 index = (int3)(get_global_id(0),get_global_id(1),get_global_id(2)); 8 | int3 dim = (int3)(width,height,depth); 9 | int3 ipos; 10 | 11 | int index1d = ((((index.z*dim.y)+(index.y))*dim.x)+(index.x)); 12 | float vox_value = src_buffer[index1d]/255.0f; 13 | 14 | float two_sigma_range_squared = 2.0f*(sigma_range*sigma_range); 15 | float two_sigma_spatial_squared = 2.0f*(sigma_spatial*sigma_spatial); 16 | 17 | float range; 18 | float domain; 19 | float domain_mult_range; 20 | float norm = 0.0; 21 | float filtered_value=0.0; 22 | 23 | //iterate over the neighbourhood 24 | int i,j,k; 25 | for (i=-sigma_spatial;i<=sigma_spatial;i++) 26 | { 27 | for (j=-sigma_spatial;j<=sigma_spatial;j++) 28 | { 29 | for (k=-sigma_spatial;k<=sigma_spatial;k++) 30 | { 31 | ipos.x = index.x+i; 32 | ipos.y = index.y+j; 33 | ipos.z = index.z+k; 34 | 35 | if(ipos.x<0) ipos.x=0; 36 | if(ipos.y<0) ipos.y=0; 37 | if(ipos.z<0) ipos.z=0; 38 | 39 | if(ipos.x>dim.x-1) ipos.x=dim.x-1; 40 | if(ipos.y>dim.y-1) ipos.y=dim.y-1; 41 | if(ipos.z>dim.z-1) ipos.z=dim.z-1; 42 | 43 | index1d = ((((ipos.z*dim.y)+(ipos.y))*dim.x)+(ipos.x)); 44 | float vox_value_i = src_buffer[index1d]/255.0f; 45 | 46 | range = -((vox_value_i-vox_value)*(vox_value_i-vox_value))/(two_sigma_range_squared); 47 | range = exp(range); 48 | 49 | domain = -((i*i)+(j*j)+(k*k)) / (two_sigma_spatial_squared); 50 | domain = exp(domain); 51 | 52 | domain_mult_range = domain*range; 53 | filtered_value += (float)(vox_value_i)*domain_mult_range; 54 | norm += domain_mult_range; 55 | } 56 | } 57 | } 58 | 59 | //save results to our output buffer 60 | index1d = ((((index.z*dim.y)+(index.y))*dim.x)+(index.x)); 61 | dst_buffer[index1d] = 255.0f*(filtered_value/norm);; 62 | } -------------------------------------------------------------------------------- /VolViewer/Kernels/boundingbox.cl: -------------------------------------------------------------------------------- 1 | // ********************************************************************* 2 | // OpenCL Kernel Function for data invert 3 | // ********************************************************************* 4 | __kernel void myFunc( __global unsigned char* src_buffer, __global unsigned char* minbb, __global unsigned char* maxbb, const int width,const int height,const int depth, const int channel) 5 | { 6 | // get index into global data array 7 | int3 index = (int3)(get_global_id(0),get_global_id(1),get_global_id(2)); 8 | int3 dim = (int3)(width,height,depth); 9 | int index1d = ((((index.z*dim.y)+(index.y))*dim.x)+(index.x)); 10 | unsigned char current = src_buffer[3*index1d+channel]; 11 | 12 | if(current>0) 13 | { 14 | if(index.xmaxbb[0]) maxbb[0]=index.x; 19 | if(index.y>maxbb[1]) maxbb[1]=index.y; 20 | if(index.z>maxbb[2]) maxbb[2]=index.z; 21 | } 22 | } 23 | 24 | __kernel void min_reduce(__global unsigned char* src_buffer, __global int* buffer, __local int* scratch, __const int length, __global int* result) 25 | { 26 | int global_index = get_global_id(0); 27 | int accumulator = INFINITY; 28 | 29 | // Loop sequentially over chunks of input vector 30 | while (global_index < length) 31 | { 32 | int element = buffer[global_index]; 33 | 34 | if(accumulator < element) accumulator = accumulator; 35 | else accumulator = element; 36 | 37 | //accumulator = (accumulator < element) ? accumulator : element; 38 | 39 | global_index += get_global_size(0); 40 | } 41 | 42 | // Perform parallel reduction 43 | int local_index = get_local_id(0); 44 | scratch[local_index] = accumulator; 45 | 46 | barrier(CLK_LOCAL_MEM_FENCE); 47 | 48 | for(int offset = get_local_size(0) / 2; offset > 0; offset = offset / 2) 49 | { 50 | if (local_index < offset) 51 | { 52 | int other = scratch[local_index + offset]; 53 | int mine = scratch[local_index]; 54 | 55 | if(mine < other) scratch[local_index] = mine; 56 | else scratch[local_index] = other; 57 | 58 | // scratch[local_index] = (mine < other) ? mine : other; 59 | } 60 | 61 | barrier(CLK_LOCAL_MEM_FENCE); 62 | } 63 | 64 | if (local_index == 0) 65 | { 66 | result[get_group_id(0)] = scratch[0]; 67 | } 68 | } -------------------------------------------------------------------------------- /VolViewer/Kernels/dilate.cl: -------------------------------------------------------------------------------- 1 | // ********************************************************************* 2 | // OpenCL Kernel Function for data invert 3 | // ********************************************************************* 4 | __kernel void myFunc( __global unsigned char* src_buffer, __global unsigned char* dst_buffer,const int width,const int height,const int depth) 5 | { 6 | // get index into global data array 7 | int3 index = (int3)(get_global_id(0),get_global_id(1),get_global_id(2)); 8 | int3 dim = (int3)(width,height,depth); 9 | int3 ipos; 10 | 11 | int index1d = ((((index.z*dim.y)+(index.y))*dim.x)+(index.x)); 12 | float current = src_buffer[index1d]; 13 | //dst_buffer[index1d] = current; 14 | 15 | int i,j,k; 16 | const int window_size = 1; 17 | 18 | if(current!=0) 19 | { 20 | //current=255; 21 | 22 | //iterate over the neighbourhood 23 | for (i=-window_size;i<=window_size;i++) 24 | { 25 | for (j=-window_size;j<=window_size;j++) 26 | { 27 | for (k=-window_size;k<=window_size;k++) 28 | { 29 | ipos.x = index.x+i; 30 | ipos.y = index.y+j; 31 | ipos.z = index.z+k; 32 | 33 | 34 | if(ipos.x<0) ipos.x=0; 35 | if(ipos.y<0) ipos.y=0; 36 | if(ipos.z<0) ipos.z=0; 37 | 38 | if(ipos.x>dim.x-1) ipos.x=dim.x-1; 39 | if(ipos.y>dim.y-1) ipos.y=dim.y-1; 40 | if(ipos.z>dim.z-1) ipos.z=dim.z-1; 41 | 42 | index1d = ((((ipos.z*dim.y)+(ipos.y))*dim.x)+(ipos.x)); 43 | 44 | //keep the values of the voxel 45 | dst_buffer[index1d] = current; 46 | } 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /VolViewer/Kernels/erode.cl: -------------------------------------------------------------------------------- 1 | // ********************************************************************* 2 | // OpenCL Kernel Function for data invert 3 | // ********************************************************************* 4 | __kernel void myFunc( __global unsigned char* src_buffer, __global unsigned char* dst_buffer,const int width,const int height,const int depth) 5 | { 6 | // get index into global data array 7 | int3 index = (int3)(get_global_id(0),get_global_id(1),get_global_id(2)); 8 | int3 dim = (int3)(width,height,depth); 9 | int3 ipos; 10 | 11 | int index1d = ((((index.z*dim.y)+(index.y))*dim.x)+(index.x)); 12 | float current = src_buffer[index1d]; 13 | int i,j,k; 14 | const int window_size = 1; 15 | 16 | if(current==0) 17 | { 18 | //iterate over the neighbourhood 19 | for (i=-window_size;i<=window_size;i++) 20 | { 21 | for (j=-window_size;j<=window_size;j++) 22 | { 23 | for (k=-window_size;k<=window_size;k++) 24 | { 25 | ipos.x = index.x+i; 26 | ipos.y = index.y+j; 27 | ipos.z = index.z+k; 28 | 29 | if(ipos.x<0) ipos.x=0; 30 | if(ipos.y<0) ipos.y=0; 31 | if(ipos.z<0) ipos.z=0; 32 | 33 | if(ipos.x>dim.x-1) ipos.x=dim.x-1; 34 | if(ipos.y>dim.y-1) ipos.y=dim.y-1; 35 | if(ipos.z>dim.z-1) ipos.z=dim.z-1; 36 | 37 | index1d = ((((ipos.z*dim.y)+(ipos.y))*dim.x)+(ipos.x)); 38 | 39 | //keep the values of the voxel 40 | dst_buffer[index1d] = 0; 41 | } 42 | } 43 | } 44 | } 45 | else 46 | { 47 | //current=255; 48 | } 49 | 50 | //save results to our output buffer 51 | index1d = ((((index.z*dim.y)+(index.y))*dim.x)+(index.x)); 52 | dst_buffer[index1d] = current; 53 | } 54 | -------------------------------------------------------------------------------- /VolViewer/Kernels/kernel_.cl: -------------------------------------------------------------------------------- 1 | // ********************************************************************* 2 | // OpenCL Kernel Function for data invert 3 | // ********************************************************************* 4 | __kernel void myFunc( __global unsigned char* src_buffer, __global unsigned char* dst_buffer,const int width,const int height,const int depth) 5 | { 6 | // get index into global data array 7 | int3 index = (int3)(get_global_id(0),get_global_id(1),get_global_id(2)); 8 | int3 dim = (int3)(width,height,depth); 9 | int3 ipos; 10 | 11 | int index1d = ((((index.z*dim.y)+(index.y))*dim.x)+(index.x)); 12 | float current = src_buffer[index1d]; 13 | int i,j,k; 14 | const int window_size = 1; 15 | 16 | if(current>0) 17 | { 18 | current=255; 19 | 20 | //iterate over the neighbourhood 21 | for (i=-window_size;i<=window_size;i++) 22 | { 23 | for (j=-window_size;j<=window_size;j++) 24 | { 25 | for (k=-window_size;k<=window_size;k++) 26 | { 27 | ipos.x = index.x+i; 28 | ipos.y = index.y+j; 29 | ipos.z = index.z+k; 30 | 31 | 32 | if(ipos.x<0) ipos.x=0; 33 | if(ipos.y<0) ipos.y=0; 34 | if(ipos.z<0) ipos.z=0; 35 | 36 | if(ipos.x>dim.x-1) ipos.x=dim.x-1; 37 | if(ipos.y>dim.y-1) ipos.y=dim.y-1; 38 | if(ipos.z>dim.z-1) ipos.z=dim.z-1; 39 | 40 | index1d = ((((ipos.z*dim.y)+(ipos.y))*dim.x)+(ipos.x)); 41 | 42 | //keep the values of the voxel 43 | dst_buffer[index1d] = 255; 44 | } 45 | } 46 | } 47 | } 48 | else 49 | { 50 | current=0; 51 | } 52 | 53 | //save results to our output buffer 54 | index1d = ((((index.z*dim.y)+(index.y))*dim.x)+(index.x)); 55 | dst_buffer[index1d] = current; 56 | } 57 | -------------------------------------------------------------------------------- /VolViewer/Kernels/median_shared.cl: -------------------------------------------------------------------------------- 1 | // ********************************************************************* 2 | // OpenCL Kernel Function for a 3D median filter 3 | // ********************************************************************* 4 | void sort(float* values, int length) 5 | { 6 | for (int i=0;ivalues[j]) 11 | { 12 | float v = values[i]; 13 | values[i] = values[j]; 14 | values[j] = v; 15 | } 16 | } 17 | } 18 | } 19 | __kernel void myFunc(read_only image3d_t src_img, __global unsigned char* dst_buffer, sampler_t smp) 20 | { 21 | // get index into global data array 22 | int4 index = (int4)(get_global_id(0),get_global_id(1),get_global_id(2),0.0); 23 | int4 dim = get_image_dim(src_img); 24 | 25 | //helpers 26 | int4 ipos; 27 | int i,j,k; 28 | int acum = 0; 29 | 30 | //filter window 31 | float sample[9]; 32 | const int window_size = 1; 33 | 34 | //iterate over the neighbourhood 35 | for (i=-window_size;i<=window_size;i++) 36 | { 37 | for (j=-window_size;j<=window_size;j++) 38 | { 39 | for (k=-window_size;k<=window_size;k++) 40 | { 41 | ipos.x = index.x+i; 42 | ipos.y = index.y+j; 43 | ipos.z = index.z+k; 44 | 45 | //keep the values of the voxel 46 | sample[acum]= read_imagef(src_img, smp, ipos).x; 47 | acum ++; 48 | } 49 | } 50 | } 51 | 52 | //apply a bubble sort 53 | sort(sample, acum); 54 | 55 | //save results to our output buffer 56 | int index1d = ((((index.z*dim.y)+(index.y))*dim.x)+(index.x)); 57 | dst_buffer[index1d] = sample[4]*255.0f; 58 | } 59 | -------------------------------------------------------------------------------- /VolViewer/Kernels/reduction.cl: -------------------------------------------------------------------------------- 1 | /*__kernel void min_reduce(__global int* buffer, __local int* tmp_buffer, __const int length, __global int* result) 2 | { 3 | int global_index = get_global_id(0); 4 | int local_index = get_local_id(0); 5 | 6 | // Load data into local memory 7 | if (global_index < length) 8 | { 9 | tmp_buffer[local_index] = buffer[global_index]; 10 | } 11 | else 12 | { 13 | // Infinity is the identity element for the min operation 14 | tmp_buffer[local_index] = INFINITY; 15 | } 16 | 17 | barrier(CLK_LOCAL_MEM_FENCE); 18 | */ 19 | /* 20 | // FIGURE 1 21 | for(int offset = 1; offset < get_local_size(0); offset <<= 1) 22 | { 23 | int mask = (offset << 1) - 1; 24 | if ((local_index & mask) == 0) 25 | { 26 | int other = tmp_buffer[local_index + offset]; 27 | int mine = tmp_buffer[local_index]; 28 | tmp_buffer[local_index] = (mine < other) ? mine : other; 29 | } 30 | 31 | barrier(CLK_LOCAL_MEM_FENCE); 32 | }*/ 33 | 34 | /* 35 | //FIGURE 2 36 | for(int offset = get_local_size(0) / 2; offset > 0; offset >>= 1) 37 | { 38 | if (local_index < offset) 39 | { 40 | int other = tmp_buffer[local_index + offset]; 41 | int mine = tmp_buffer[local_index]; 42 | tmp_buffer[local_index] = (mine < other) ? mine : other; 43 | } 44 | barrier(CLK_LOCAL_MEM_FENCE); 45 | } 46 | 47 | if (local_index == 0) 48 | { 49 | result[get_group_id(0)] = tmp_buffer[0]; 50 | } 51 | }*/ 52 | __kernel void min_reduce(__global int* buffer, __local int* scratch, __const int length, __global int* result) 53 | { 54 | int global_index = get_global_id(0); 55 | int accumulator = INFINITY; 56 | 57 | // Loop sequentially over chunks of input vector 58 | while (global_index < length) 59 | { 60 | int element = buffer[global_index]; 61 | 62 | if(accumulator < element) accumulator = accumulator; 63 | else accumulator = element; 64 | 65 | //accumulator = (accumulator < element) ? accumulator : element; 66 | 67 | global_index += get_global_size(0); 68 | } 69 | 70 | // Perform parallel reduction 71 | int local_index = get_local_id(0); 72 | scratch[local_index] = accumulator; 73 | 74 | barrier(CLK_LOCAL_MEM_FENCE); 75 | 76 | for(int offset = get_local_size(0) / 2; offset > 0; offset = offset / 2) 77 | { 78 | if (local_index < offset) 79 | { 80 | int other = scratch[local_index + offset]; 81 | int mine = scratch[local_index]; 82 | 83 | if(mine < other) scratch[local_index] = mine; 84 | else scratch[local_index] = other; 85 | 86 | // scratch[local_index] = (mine < other) ? mine : other; 87 | } 88 | 89 | barrier(CLK_LOCAL_MEM_FENCE); 90 | } 91 | 92 | if (local_index == 0) 93 | { 94 | result[get_group_id(0)] = scratch[0]; 95 | } 96 | } -------------------------------------------------------------------------------- /VolViewer/Shaders/Copy of volume_allchannelsLAMBERTIAN.vert: -------------------------------------------------------------------------------- 1 | varying vec3 V; 2 | varying vec3 V1; 3 | 4 | void main() 5 | { 6 | V = vec3(gl_ModelViewMatrix * (gl_Vertex) ); 7 | V1 = vec3(gl_Vertex); 8 | 9 | //Calculate vertex's texture coordinate 10 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; 11 | 12 | gl_ClipVertex = gl_ModelViewMatrix*gl_Vertex; 13 | 14 | //Calculate vertex's final, transformed position. 15 | gl_Position = ftransform(); 16 | } -------------------------------------------------------------------------------- /VolViewer/Shaders/celshading.frag: -------------------------------------------------------------------------------- 1 | varying vec3 vNormal; 2 | varying vec3 vVertex; 3 | varying vec3 vEye; 4 | 5 | #define shininess 20.0 6 | 7 | void main (void) 8 | { 9 | vec4 color0 = vec4(0.8, 0.8, 0.8, 1.0); // Material Color: 0.8, 0.0, 0.0, 1.0 10 | vec4 color1 = vec4(0.0, 0.0, 0.0, 1.0); // Silhouette Color: black 11 | vec4 color2 = vec4(0.4, 0.4, 0.4, 1.0); // Specular Color: 0.8, 0.0, 0.0, 1.0 12 | 13 | vNormal = vNormal; 14 | 15 | // Lighting 16 | vec3 eyePos = vEye.xyz; 17 | vec3 lightPos = vec3(gl_LightSource[0].position); 18 | 19 | vec3 EyeVert = normalize(eyePos - vVertex); 20 | vec3 LightVert = normalize(lightPos - vVertex); 21 | vec3 EyeLight = normalize(LightVert+EyeVert); 22 | vec3 Normal = normalize(gl_NormalMatrix * vNormal); 23 | 24 | // Simple Silhouette 25 | float sil = max(dot(Normal,EyeVert), 0.0); 26 | 27 | if (sil < 0.5) gl_FragColor = color1; 28 | else 29 | { 30 | 31 | gl_FragColor = color0 ; //* sil; 32 | 33 | // Specular part 34 | float spec = pow(max(dot(Normal,EyeLight),0.0), shininess); 35 | 36 | if (spec < 0.25) gl_FragColor *= 0.8; 37 | else gl_FragColor = color2; 38 | 39 | //gl_FragColor += color2*smoothstep(0.1,0.4,spec); 40 | gl_FragColor += color2*step(0.4,spec); 41 | 42 | gl_FragColor += spec; // advanced 3D Toon 43 | 44 | // Diffuse part 45 | float diffuse = max(dot(Normal,LightVert),0.0); 46 | if (diffuse < 0.5) gl_FragColor *=0.8; 47 | 48 | gl_FragColor.w = 1.0; 49 | 50 | } 51 | } -------------------------------------------------------------------------------- /VolViewer/Shaders/celshading.vert: -------------------------------------------------------------------------------- 1 | varying vec3 vNormal; 2 | varying vec3 vVertex; 3 | varying vec3 vEye; 4 | 5 | void main(void) 6 | { 7 | vVertex = gl_Vertex.xyz; 8 | vNormal = gl_Normal; 9 | vEye = vec4(0,0,512.0,0); 10 | 11 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; 12 | gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex; 13 | } 14 | -------------------------------------------------------------------------------- /VolViewer/Shaders/perfragment.frag: -------------------------------------------------------------------------------- 1 | varying vec3 normal, lightDir, halfVector; 2 | uniform vec3 surfcol; 3 | 4 | void main() 5 | { 6 | vec4 diffuseLight, specularLight; 7 | float shine = 32.0; 8 | vec3 n = normalize(normal); 9 | 10 | float lightIntensity = max(dot(n, normalize(lightDir)), 0.0); 11 | 12 | diffuseLight = lightIntensity * gl_LightSource[0].diffuse; 13 | specularLight = pow(max(dot(n, normalize(halfVector)), 0.0), shine) * gl_LightSource[0].specular; 14 | 15 | gl_FragColor = vec4(surfcol,1.0)*(diffuseLight + specularLight + gl_LightSource[0].ambient); 16 | } -------------------------------------------------------------------------------- /VolViewer/Shaders/perfragment.vert: -------------------------------------------------------------------------------- 1 | varying vec3 normal, lightDir, halfVector; 2 | uniform vec3 surfcol; 3 | 4 | void main() 5 | { 6 | vec4 worldPos; 7 | 8 | normal = normalize(gl_NormalMatrix * gl_Normal); 9 | 10 | worldPos = gl_Vertex; 11 | lightDir = normalize(vec3(gl_LightSource[0].position - worldPos)); 12 | 13 | halfVector = normalize(gl_LightSource[0].halfVector.xyz); 14 | 15 | gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex; 16 | gl_Position = ftransform(); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /VolViewer/Shaders/ssao.vert: -------------------------------------------------------------------------------- 1 | varying vec2 texCoord; 2 | 3 | void main(void) { 4 | gl_Position = ftransform(); 5 | texCoord=gl_MultiTexCoord0.xy; 6 | gl_FrontColor = gl_Color; 7 | } 8 | -------------------------------------------------------------------------------- /VolViewer/Shaders/unsharp.frag: -------------------------------------------------------------------------------- 1 | varying vec2 TexCoord; //current texcoord 2 | 3 | //uniform sampler2D depth_texture; 4 | uniform sampler2D scene_texture; 5 | 6 | uniform float texwidth; //texture_width 7 | uniform float kernel[9]; // kernel 8 | uniform float kernel_norm; // kernel normalisation 9 | uniform float postprocess2d_amount; //amount of filter to add in 10 | //uniform vec2 camerarange; 11 | 12 | /*float readDepth( in vec2 coord ) { 13 | return (2.0 * camerarange.x) / (camerarange.y + camerarange.x - texture2D( depth_texture, coord ).x * (camerarange.y - camerarange.x)); 14 | }*/ 15 | 16 | void main() 17 | { 18 | float stepsize = 1.0/texwidth; 19 | 20 | //image color 21 | vec4 originalcolor = texture2D(scene_texture,TexCoord); 22 | 23 | //apply our kernel 24 | vec4 finalcolor; 25 | finalcolor = texture2D(scene_texture,TexCoord+vec2(-stepsize,stepsize)) * kernel[0]; 26 | finalcolor += texture2D(scene_texture,TexCoord+vec2(0, stepsize)) * kernel[1]; 27 | finalcolor += texture2D(scene_texture,TexCoord+vec2(stepsize, stepsize)) * kernel[2]; 28 | finalcolor += texture2D(scene_texture,TexCoord+vec2(-stepsize,0)) * kernel[3]; 29 | finalcolor += texture2D(scene_texture,TexCoord)* kernel[4]; 30 | finalcolor += texture2D(scene_texture,TexCoord+vec2(stepsize,0)) * kernel[5]; 31 | finalcolor += texture2D(scene_texture,TexCoord+vec2(-stepsize,-stepsize)) * kernel[6]; 32 | finalcolor += texture2D(scene_texture,TexCoord+vec2(0,-stepsize)) * kernel[7]; 33 | finalcolor += texture2D(scene_texture,TexCoord+vec2(stepsize,-stepsize)) * kernel[8]; 34 | finalcolor /= kernel_norm; 35 | 36 | //convert to luminance to avoid colour shifts on rgb images 37 | float orig = (originalcolor.x + originalcolor.y + originalcolor.z)/3.0; 38 | float fin = (finalcolor.x + finalcolor.y + finalcolor.z)/3.0; 39 | 40 | //mask 41 | vec4 maskcolor = vec4(orig-fin); 42 | 43 | vec4 mask = postprocess2d_amount*maskcolor; 44 | 45 | //add them 46 | finalcolor = originalcolor+mask; 47 | 48 | //set alpha to 1.0 49 | finalcolor.w = 1.0; 50 | 51 | gl_FragColor = finalcolor; 52 | } -------------------------------------------------------------------------------- /VolViewer/Shaders/unsharp.vert: -------------------------------------------------------------------------------- 1 | varying vec2 TexCoord; 2 | 3 | void main(void) 4 | { 5 | TexCoord = vec2(gl_MultiTexCoord0); 6 | gl_TexCoord[0] = gl_MultiTexCoord0; 7 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; 8 | } 9 | -------------------------------------------------------------------------------- /VolViewer/Shaders/vol2d.frag: -------------------------------------------------------------------------------- 1 | uniform sampler2D Texmap0; 2 | uniform sampler2D RGBlookupTexture; 3 | uniform sampler2D RAGABAlookupTexture; 4 | 5 | void main() 6 | { 7 | vec4 texValue0 = texture2D(Texmap0, gl_TexCoord[0].xy); 8 | 9 | //============================== 10 | //APLY OUR TRANSFER FUNCTION 11 | //============================== 12 | 13 | //get lookup table values 14 | //r,g,b,ra,ga,ba 15 | vec3 RGBlookupValue, RAGABAlookupValue; 16 | RGBlookupValue.x = (texture2D(RGBlookupTexture, vec2(texValue0.x, 0.5))).x; 17 | RAGABAlookupValue.x = (texture2D(RAGABAlookupTexture, vec2(texValue0.x, 0.5))).x; 18 | 19 | //============================== 20 | //NOW APLY OUR BLENDING 21 | //============================== 22 | vec4 finalColour = vec4(RGBlookupValue.x,RGBlookupValue.x,RGBlookupValue.x, RAGABAlookupValue.x); 23 | 24 | //assing the colour to our final colour 25 | gl_FragColor = finalColour; 26 | } 27 | -------------------------------------------------------------------------------- /VolViewer/Shaders/vol2d.vert: -------------------------------------------------------------------------------- 1 | void main() 2 | { 3 | // 4 | // vec4 pos = gl_ModelViewMatrix*gl_Vertex; 5 | 6 | //Calculate vertex's texture coordinate 7 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; 8 | 9 | // gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex; 10 | 11 | //Calculate vertex's final, transformed position. 12 | gl_Position = ftransform(); 13 | } -------------------------------------------------------------------------------- /VolViewer/Shaders/vol2dtrilin.frag: -------------------------------------------------------------------------------- 1 | uniform int channel; 2 | uniform sampler2D Texmap0; 3 | uniform sampler2D Texmap1; 4 | uniform sampler2D RGBlookupTexture; 5 | uniform sampler2D RAGABAlookupTexture; 6 | 7 | void main() 8 | { 9 | vec4 texValue0 = texture2D(Texmap0, gl_TexCoord[0].xy); 10 | vec4 texValue1 = texture2D(Texmap1, gl_TexCoord[0].xy); 11 | vec4 result = mix(texValue0, texValue1, gl_TexCoord[0].z); 12 | 13 | //============================== 14 | //APLY OUR TRANSFER FUNCTION 15 | //============================== 16 | 17 | //get lookup table values 18 | //r,g,b,ra,ga,ba 19 | vec3 RGBlookupValue, RAGABAlookupValue; 20 | RGBlookupValue.x = (texture2D(RGBlookupTexture, vec2(result.x, 0.0))).x; 21 | RAGABAlookupValue.x = (texture2D(RAGABAlookupTexture, vec2(result.x, 0.0))).x; 22 | RGBlookupValue.y = (texture2D(RGBlookupTexture, vec2(result.y, 0.0))).x; 23 | RAGABAlookupValue.y = (texture2D(RAGABAlookupTexture, vec2(result.y, 0.0))).x; 24 | RGBlookupValue.z = (texture2D(RGBlookupTexture, vec2(result.z, 0.0))).x; 25 | RAGABAlookupValue.z = (texture2D(RAGABAlookupTexture, vec2(result.z, 0.0))).x; 26 | 27 | //============================== 28 | //NOW APLY OUR BLENDING 29 | //============================== 30 | vec4 finalColour=vec4(0.0); // = vec4(RGBlookupValue.z,RGBlookupValue.z,RGBlookupValue.z, RAGABAlookupValue.z); 31 | 32 | if(channel==0) 33 | { 34 | finalColour = vec4(RGBlookupValue.x,0.0,0.0, RAGABAlookupValue.x); 35 | } 36 | else if(channel==1) 37 | { 38 | finalColour = vec4(0.0,RGBlookupValue.y,0.0, RAGABAlookupValue.y); 39 | } 40 | else if(channel==2) 41 | { 42 | finalColour = vec4(0.0,0.0,RGBlookupValue.z, RAGABAlookupValue.z); 43 | } 44 | else if(channel==3) 45 | { 46 | finalColour = vec4(RGBlookupValue.x,RGBlookupValue.x,RGBlookupValue.x, RAGABAlookupValue.x); 47 | } 48 | 49 | //assing the colour to our final colour 50 | gl_FragColor = finalColour; 51 | } 52 | -------------------------------------------------------------------------------- /VolViewer/Shaders/vol2dtrilin.vert: -------------------------------------------------------------------------------- 1 | void main() 2 | { 3 | // 4 | // vec4 pos = gl_ModelViewMatrix*gl_Vertex; 5 | 6 | //Calculate vertex's texture coordinate 7 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; 8 | 9 | // gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex; 10 | 11 | //Calculate vertex's final, transformed position. 12 | gl_Position = ftransform(); 13 | } -------------------------------------------------------------------------------- /VolViewer/Shaders/volume_allchannelsBLING-PHONG.vert: -------------------------------------------------------------------------------- 1 | uniform vec3 eye; 2 | 3 | varying vec3 V; 4 | varying vec3 V1; 5 | varying vec3 L; 6 | varying vec3 viewVec; 7 | varying vec3 texCoord; 8 | 9 | void main() 10 | { 11 | texCoord = gl_MultiTexCoord0.xyz; 12 | viewVec = vec3(gl_ModelViewMatrix * vec4(eye,0)); 13 | V = vec3(gl_ModelViewMatrix * gl_Vertex); 14 | V1 = vec3(ftransform()); 15 | L = V1-(gl_TextureMatrix[0]*gl_LightSource[0].position).xyz; 16 | L = normalize(L); 17 | 18 | //Calculate vertex's texture coordinate 19 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; 20 | 21 | gl_ClipVertex = gl_ModelViewMatrix*gl_Vertex; 22 | 23 | //Calculate vertex's final, transformed position. 24 | gl_Position = ftransform(); 25 | } -------------------------------------------------------------------------------- /VolViewer/Shaders/volume_allchannelsBLING-PHONG2SP.vert: -------------------------------------------------------------------------------- 1 | varying vec3 V; 2 | varying vec3 V1; 3 | varying vec3 L; 4 | 5 | void main() 6 | { 7 | V = vec3(gl_ModelViewMatrix * gl_Vertex); 8 | V1 = vec3(ftransform()); 9 | L = V1-(gl_TextureMatrix[0]*gl_LightSource[0].position).xyz; 10 | L = normalize(L); 11 | 12 | //Calculate vertex's texture coordinate 13 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; 14 | 15 | gl_ClipVertex = gl_ModelViewMatrix*gl_Vertex; 16 | 17 | //Calculate vertex's final, transformed position. 18 | gl_Position = ftransform(); 19 | } -------------------------------------------------------------------------------- /VolViewer/Shaders/volume_allchannelsBLING-PHONG_CT.vert: -------------------------------------------------------------------------------- 1 | varying vec3 V; 2 | varying vec3 V1; 3 | 4 | void main() 5 | { 6 | V = vec3(gl_ModelViewMatrix * gl_Vertex); 7 | V1 = vec3(ftransform()); 8 | 9 | //Calculate vertex's texture coordinate 10 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; 11 | 12 | gl_ClipVertex = gl_ModelViewMatrix*gl_Vertex; 13 | 14 | //Calculate vertex's final, transformed position. 15 | gl_Position = ftransform(); 16 | } -------------------------------------------------------------------------------- /VolViewer/Shaders/volume_allchannelsCLIP.vert: -------------------------------------------------------------------------------- 1 | varying vec3 V; 2 | varying vec3 V1; 3 | 4 | void main() 5 | { 6 | V = vec3(gl_ModelViewMatrix * gl_Vertex); 7 | V1 = vec3(ftransform()); 8 | 9 | //Calculate vertex's texture coordinate 10 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; 11 | 12 | gl_ClipVertex = gl_ModelViewMatrix*gl_Vertex; 13 | 14 | //Calculate vertex's final, transformed position. 15 | gl_Position = ftransform(); 16 | } -------------------------------------------------------------------------------- /VolViewer/Shaders/volume_allchannelsDEPTH.vert: -------------------------------------------------------------------------------- 1 | varying vec3 V; 2 | varying vec3 V1; 3 | varying vec3 L; 4 | 5 | void main() 6 | { 7 | V = vec3(gl_ModelViewMatrix * gl_Vertex); 8 | V1 = vec3(ftransform()); 9 | L = V1-(gl_TextureMatrix[0]*gl_LightSource[0].position).xyz; 10 | L = normalize(L); 11 | 12 | //Calculate vertex's texture coordinate 13 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; 14 | gl_ClipVertex = gl_ModelViewMatrix*gl_Vertex; 15 | 16 | //Calculate vertex's final, transformed position. 17 | gl_Position = ftransform(); 18 | } -------------------------------------------------------------------------------- /VolViewer/Shaders/volume_allchannelsGOOCH.vert: -------------------------------------------------------------------------------- 1 | varying vec3 V; 2 | varying vec3 V1; 3 | varying vec3 L; 4 | varying vec3 viewVec; 5 | varying vec3 texCoord; 6 | 7 | void main() 8 | { 9 | texCoord = gl_MultiTexCoord0.xyz; 10 | viewVec = vec3(gl_ModelViewMatrix * vec4(0,0,-1,0)); 11 | V = vec3(gl_ModelViewMatrix *gl_Vertex); 12 | V1 = vec3(ftransform()); 13 | L = V1-(gl_TextureMatrix[0]*gl_LightSource[0].position).xyz; 14 | L = normalize(L); 15 | 16 | //Calculate vertex's texture coordinate 17 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; 18 | 19 | gl_ClipVertex = gl_ModelViewMatrix*gl_Vertex; 20 | 21 | //Calculate vertex's final, transformed position. 22 | gl_Position = ftransform(); 23 | } -------------------------------------------------------------------------------- /VolViewer/Shaders/volume_allchannelsLAMBERTIAN.vert: -------------------------------------------------------------------------------- 1 | varying vec3 V; 2 | varying vec3 V1; 3 | varying vec3 L; 4 | 5 | void main() 6 | { 7 | V = vec3(gl_ModelViewMatrix * (gl_Vertex) ); 8 | V1 = vec3(ftransform()); 9 | L = V1-(gl_TextureMatrix[0]*gl_LightSource[0].position).xyz; 10 | L = normalize(L); 11 | 12 | //Calculate vertex's texture coordinate 13 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; 14 | 15 | gl_ClipVertex = gl_ModelViewMatrix*gl_Vertex; 16 | 17 | //Calculate vertex's final, transformed position. 18 | gl_Position = ftransform(); 19 | } -------------------------------------------------------------------------------- /VolViewer/Shaders/volume_allchannelsNOLIGHT.vert: -------------------------------------------------------------------------------- 1 | void main() 2 | { 3 | //Calculate vertex's texture coordinate 4 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; 5 | gl_ClipVertex = gl_ModelViewMatrix*gl_Vertex; 6 | 7 | //Calculate vertex's final, transformed position. 8 | gl_Position = ftransform(); 9 | } -------------------------------------------------------------------------------- /VolViewer/Shaders/volume_allchannelsSEM.vert: -------------------------------------------------------------------------------- 1 | varying vec3 V; 2 | varying vec3 V1; 3 | varying vec3 L; 4 | 5 | void main() 6 | { 7 | V = vec3(gl_ModelViewMatrix *gl_Vertex); 8 | V1 = vec3(ftransform()); 9 | L = V1-(gl_TextureMatrix[0]*gl_LightSource[0].position).xyz; 10 | L = normalize(L); 11 | 12 | //Calculate vertex's texture coordinate 13 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; 14 | 15 | gl_ClipVertex = gl_ModelViewMatrix*gl_Vertex; 16 | 17 | //Calculate vertex's final, transformed position. 18 | gl_Position = ftransform(); 19 | } -------------------------------------------------------------------------------- /VolViewer/Shaders/volume_allchannelsSINGPASS_NOLIGHT.frag: -------------------------------------------------------------------------------- 1 | 2 | uniform sampler3D volumeTextureR; 3 | uniform sampler3D volumeTextureG; 4 | uniform sampler3D volumeTextureB; 5 | uniform sampler2D RGBlookupTexture; 6 | 7 | void main() 8 | { 9 | //retrieve our texture coordinate 10 | vec3 texcoord = gl_TexCoord[0].stp; 11 | 12 | //get the texture rgb data 13 | float texValueR = texture3D(volumeTextureR, texcoord).x; 14 | float texValueG = texture3D(volumeTextureG, texcoord).x; 15 | float texValueB = texture3D(volumeTextureB, texcoord).x; 16 | 17 | //get lookup table values 18 | //r,g,b,ra,ga,ba 19 | vec4 RGBlookupValue = vec4(0.0); 20 | RGBlookupValue.x = texture2D(RGBlookupTexture, vec2(texValueR, 0.0)).x; 21 | RGBlookupValue.y = texture2D(RGBlookupTexture, vec2(texValueG, 0.0)).y; 22 | RGBlookupValue.z = texture2D(RGBlookupTexture, vec2(texValueB, 0.0)).z; 23 | 24 | //max 25 | RGBlookupValue.w = RGBlookupValue.x; 26 | RGBlookupValue.w = max(RGBlookupValue.w, RGBlookupValue.y); 27 | RGBlookupValue.w = max(RGBlookupValue.w, RGBlookupValue.z); 28 | 29 | /* 30 | //min 31 | RGBlookupValue.w = RGBlookupValue.x; 32 | RGBlookupValue.w = min(RGBlookupValue.w, RGBlookupValue.y); 33 | RGBlookupValue.w = min(RGBlookupValue.w, RGBlookupValue.z); 34 | */ 35 | 36 | /* 37 | //average 38 | //RGBlookupValue.w = (RGBlookupValue.x+RGBlookupValue.y+RGBlookupValue.z)/3.0; 39 | */ 40 | //assing the colour to our final colour 41 | gl_FragColor = RGBlookupValue; 42 | } -------------------------------------------------------------------------------- /VolViewer/Shaders/volume_allchannelsSINGPASS_NOLIGHT.vert: -------------------------------------------------------------------------------- 1 | 2 | uniform sampler3D volumeTextureR; 3 | uniform sampler3D volumeTextureG; 4 | uniform sampler3D volumeTextureB; 5 | uniform sampler2D RGBlookupTexture; 6 | 7 | void main() 8 | { 9 | //Calculate vertex's texture coordinate 10 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; 11 | 12 | gl_ClipVertex = gl_ModelViewMatrix*gl_Vertex; 13 | 14 | //Calculate vertex's final, transformed position. 15 | gl_Position = ftransform(); 16 | } 17 | -------------------------------------------------------------------------------- /VolViewer/Shaders/volume_allchannelsXRAY.vert: -------------------------------------------------------------------------------- 1 | varying vec3 V; 2 | varying vec3 V1; 3 | varying vec3 dir; 4 | varying vec3 I; 5 | 6 | void main() 7 | { 8 | V = vec3(gl_ModelViewMatrix * gl_Vertex); 9 | V1 = vec3(gl_Vertex); 10 | I = V; 11 | 12 | dir = vec3(gl_ModelViewMatrix*vec4(0,0,-1,1)); 13 | 14 | //Calculate vertex's texture coordinate 15 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; 16 | 17 | gl_ClipVertex = gl_ModelViewMatrix*gl_Vertex; 18 | 19 | //Calculate vertex's final, transformed position. 20 | gl_Position = ftransform(); 21 | } 22 | -------------------------------------------------------------------------------- /VolViewer/Shaders/volume_sections.frag: -------------------------------------------------------------------------------- 1 | 2 | uniform int channel; 3 | uniform sampler3D volumeTextureR; 4 | uniform sampler3D volumeTextureG; 5 | uniform sampler3D volumeTextureB; 6 | uniform sampler2D RGBlookupTexture; 7 | 8 | void main() 9 | { 10 | 11 | vec3 texcoord = gl_TexCoord[0].stp; 12 | 13 | //get the texture rgb data 14 | vec3 texValue; 15 | texValue.x = texture3D(volumeTextureR, texcoord).x; 16 | texValue.y = texture3D(volumeTextureG, texcoord).x; 17 | texValue.z = texture3D(volumeTextureB, texcoord).x; 18 | 19 | //============================== 20 | //APLY OUR TRANSFER FUNCTION 21 | //============================== 22 | //make sure we sample from centre of lookup table 23 | //float lookup_offset = (1.0/256.0/2.0); 24 | //texValue += lookup_offset; 25 | 26 | //get lookup table values 27 | //r,g,b,ra,ga,ba 28 | vec4 finalColour = vec4(0.0); 29 | 30 | //get lookup table values. 31 | vec3 RGBlookupValue = vec3(0.0); 32 | 33 | RGBlookupValue.x = texture2D(RGBlookupTexture, vec2(texValue.x, 0.0)).x; 34 | RGBlookupValue.y = texture2D(RGBlookupTexture, vec2(texValue.y, 0.0)).y; 35 | RGBlookupValue.z = texture2D(RGBlookupTexture, vec2(texValue.z, 0.0)).z; 36 | 37 | finalColour = vec4(RGBlookupValue,1.0); 38 | 39 | if(RGBlookupValue.x==0.0 && RGBlookupValue.y==0.0 && RGBlookupValue.z==0.0) finalColour.w = 0.0; 40 | else finalColour.w = 1.0; 41 | 42 | if(finalColour.w==0.0) discard; 43 | 44 | //assing the colour to our final colour 45 | gl_FragColor = finalColour; 46 | } -------------------------------------------------------------------------------- /VolViewer/Shaders/volume_sections.vert: -------------------------------------------------------------------------------- 1 | void main() 2 | { 3 | //Calculate vertex's texture coordinate 4 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; 5 | 6 | gl_ClipVertex = gl_ModelViewMatrix*gl_Vertex; 7 | 8 | //Calculate vertex's final, transformed position. 9 | gl_Position = ftransform(); 10 | } 11 | -------------------------------------------------------------------------------- /VolViewer/Shaders/volume_singlechannelNOLIGHT.frag: -------------------------------------------------------------------------------- 1 | uniform int channel; 2 | uniform sampler3D volumeTexture; 3 | uniform sampler2D RGBlookupTexture; 4 | uniform sampler2D RAGABAlookupTexture; 5 | 6 | void main() 7 | { 8 | 9 | vec3 texcoord = gl_TexCoord[0].stp; //+ texture2D(noiseTexture, dir*V/32); 10 | 11 | //get the texture rgb data 12 | float texValue; 13 | texValue = texture3D(volumeTexture, texcoord).x; 14 | 15 | //======================================== 16 | //GET OUR VOXEL COORDINATE AND RGB VALUE 17 | //======================================== 18 | //get our coord in screen space (nb) screen space is always -128 -> 128 19 | //vec3 voxelcoord = 256.0*(vec3(gl_TexCoord[0].s, gl_TexCoord[0].t, gl_TexCoord[0].p))-128.0; 20 | 21 | //============================== 22 | //APLY OUR TRANSFER FUNCTION 23 | //============================== 24 | //make sure we sample from centre of lookup table 25 | float lookup_offset = (1.0/512.0/2.0); 26 | texValue += lookup_offset; 27 | 28 | //get lookup table values 29 | //r,g,b,ra,ga,ba 30 | vec3 RGBlookupValue, RAGABAlookupValue; 31 | RGBlookupValue = RAGABAlookupValue = vec3(0.0,0.0,0.0); 32 | vec4 finalColour = vec4(0.0,0.0,0.0,0.0); 33 | 34 | // if(channel==0) 35 | { 36 | RGBlookupValue.x = texture2D(RGBlookupTexture, vec2(texValue, 0.5)).x; 37 | RAGABAlookupValue.x = texture2D(RAGABAlookupTexture, vec2(texValue, 0.5)).x; 38 | finalColour = vec4(RGBlookupValue.x,0.0,0.0, RAGABAlookupValue.x); 39 | } 40 | /* if(channel==1) 41 | { 42 | RGBlookupValue.y = texture2D(RGBlookupTexture, vec2(texValue, 0.5)).y; 43 | RAGABAlookupValue.y = texture2D(RAGABAlookupTexture, vec2(texValue, 0.5)).y; 44 | finalColour = vec4(0.0,RGBlookupValue.y,0.0, RAGABAlookupValue.y); 45 | } 46 | if(channel==2) 47 | { 48 | RGBlookupValue.z = texture2D(RGBlookupTexture, vec2(texValue, 0.5)).z; 49 | RAGABAlookupValue.z = texture2D(RAGABAlookupTexture, vec2(texValue, 0.5)).z; 50 | finalColour = vec4(0.0,0.0,RGBlookupValue.z, RAGABAlookupValue.z); 51 | } 52 | if(channel==3) 53 | { 54 | RGBlookupValue.x = texture2D(RGBlookupTexture, vec2(texValue, 0.5)).x; 55 | RAGABAlookupValue.x = texture2D(RAGABAlookupTexture, vec2(texValue, 0.5)).x; 56 | finalColour = vec4(RGBlookupValue.x,RGBlookupValue.x,RGBlookupValue.x, RAGABAlookupValue.x); 57 | }*/ 58 | 59 | //finalColour.rgb *= finalColour.a; 60 | if(finalColour.w==0.0) discard; 61 | 62 | //assing the colour to our final colour 63 | gl_FragColor = finalColour; 64 | //gl_FragColor.rgb *= gl_FragColor.a; 65 | } -------------------------------------------------------------------------------- /VolViewer/Shaders/volume_singlechannelNOLIGHT.vert: -------------------------------------------------------------------------------- 1 | void main() 2 | { 3 | //Calculate vertex's texture coordinate 4 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; 5 | 6 | gl_ClipVertex = gl_ModelViewMatrix*gl_Vertex; 7 | 8 | //Calculate vertex's final, transformed position. 9 | gl_Position = ftransform(); 10 | } -------------------------------------------------------------------------------- /VolViewer/Shaders/xray.frag: -------------------------------------------------------------------------------- 1 | // vertex to fragment shader io 2 | varying vec3 N; 3 | varying vec3 I; 4 | varying vec4 Cs; 5 | 6 | 7 | // entry point 8 | void main() 9 | { 10 | 11 | float edgefalloff = 1.0; 12 | float opac = dot(normalize(N), normalize(-I)); 13 | opac = abs(opac); 14 | opac = 1.0-pow(opac, edgefalloff); 15 | 16 | gl_FragColor = opac * Cs; 17 | //gl_FragColor.a = opac; 18 | //gl_FragColor = 1.0 - gl_FragColor; 19 | gl_FragColor.w = 1.0; 20 | } 21 | -------------------------------------------------------------------------------- /VolViewer/Shaders/xray.vert: -------------------------------------------------------------------------------- 1 | // Application to vertex shader 2 | varying vec3 N; 3 | varying vec3 I; 4 | varying vec4 Cs; 5 | 6 | void main() 7 | { 8 | vec4 P = gl_ModelViewMatrix * gl_Vertex; 9 | 10 | I = gl_Vertex; 11 | 12 | N = gl_NormalMatrix * gl_Normal; 13 | Cs = gl_Color; 14 | 15 | gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex; 16 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; 17 | } 18 | -------------------------------------------------------------------------------- /VolViewer/VolViewer.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /VolViewer/src/ArcBall.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef ARCBALL_H 6 | #define ARCBALL_H 7 | 8 | #include 9 | #include 10 | 11 | //assuming IEEE-754(GLfloat), which i believe has max precision of 7 bits 12 | #define Epsilon 1.0e-5 13 | 14 | #include "Vector.h" 15 | #include "Matrix.h" 16 | #include "Quaternion.h" 17 | 18 | class ArcBall 19 | { 20 | 21 | public: 22 | 23 | ArcBall(); 24 | ArcBall(GLfloat NewWidth, GLfloat NewHeight); 25 | ~ArcBall(); 26 | 27 | int rot_type; 28 | int orien_type; 29 | 30 | bool isDragging; 31 | bool isZooming; 32 | bool isTranslate; 33 | 34 | Vector oldpos; 35 | 36 | //Final Transform 37 | Matrix4fT Transform; 38 | //Last Rotation 39 | Matrix3fT LastRot; 40 | //This Rotation 41 | Matrix3fT ThisRot; 42 | 43 | Vector StVec; //Saved click vector 44 | Vector EnVec; //Saved drag vector 45 | GLfloat AdjustWidth; //Mouse bounds width 46 | GLfloat AdjustHeight; //Mouse bounds height 47 | 48 | void setBounds(GLfloat NewWidth, GLfloat NewHeight); 49 | void clickDrag(const Vector* mouspos); 50 | void clickZoom(const Vector* mouspos); 51 | void clickTranslate(const Vector* mouspos); 52 | void mousemotion(const Vector* mouspos); 53 | void drag(const Vector* NewPt); 54 | void translate(float x, float y, float z); 55 | inline void _mapToSphere(const Vector* NewPt, Vector* NewVec) const; 56 | void setIdentity(void); 57 | 58 | void addRotation(Matrix3fT mat); 59 | 60 | void rotateX(double angle); 61 | void rotateY(double angle); 62 | void rotateZ(double angle); 63 | 64 | const ArcBall& operator= (const ArcBall& right); 65 | }; 66 | 67 | #endif //ARCBALL_H 68 | 69 | -------------------------------------------------------------------------------- /VolViewer/src/BSpline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef BSPLINE_H 6 | #define BSPLINE_H 7 | 8 | #include 9 | #include 10 | using namespace std; 11 | 12 | #include "Vector.h" 13 | 14 | class BSpline 15 | { 16 | public: 17 | 18 | BSpline(); 19 | ~BSpline(); 20 | 21 | bool linear; 22 | 23 | //control points 24 | int num_control_points; 25 | vector control_points; 26 | vector control_points_colours; 27 | 28 | //curve points 29 | int num_curve_points; 30 | vector curve_points; 31 | 32 | //degree of the polynomial 33 | int poly_degree; 34 | 35 | //our curve intervals 36 | vector u; 37 | 38 | void clear(void); 39 | void init(int ncontp, int ncurvp, int d); 40 | void compute(void); 41 | void compute_with_skip(int skip); 42 | 43 | // calculate the blending value 44 | double blend(int k, int t, double v); 45 | 46 | // figure out the knots 47 | void compute_intervals(void); 48 | 49 | //compute our curve point 50 | void compute_point(double v, Vector* output); 51 | void compute_point_with_skip(double v, Vector* output, int skip); 52 | 53 | const BSpline& operator= (const BSpline& right); 54 | 55 | }; 56 | 57 | #endif // BSPLINE_H -------------------------------------------------------------------------------- /VolViewer/src/Camera.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef CAMERA_H 6 | #define CAMERA_H 7 | 8 | #include 9 | //Added by qt3to4: 10 | #include 11 | 12 | #include "Vector.h" 13 | #include "Quaternion.h" 14 | 15 | 16 | class Camera 17 | { 18 | public: 19 | 20 | Camera(); 21 | Camera(const Vector & eye, const Vector & at, const Vector & up); 22 | Camera(const Vector & eye, const Vector & at); 23 | Camera(const Vector & eye); 24 | 25 | void set(const Vector & eye, const Vector & at, const Vector & up); 26 | void set(const Vector & eye, const Vector & at); 27 | void set(const Vector & eye); 28 | 29 | void update(const Vector & e, const Vector & m); 30 | void display_cursor(void); 31 | 32 | void moveUp(float dist); 33 | void moveForward(float dist); 34 | void moveLeft(float dist); 35 | void pitchUp(double angle); 36 | void headingLeft(double angle); 37 | void rotateLeft(double angle); 38 | void rotateUp(double angle); 39 | void zoomIn(float dist); 40 | 41 | void aim(); 42 | void idle(); 43 | void reshape(int w, int h); 44 | 45 | void mouse_move(QMouseEvent * e ); 46 | void mouse_press(QMouseEvent * e ); 47 | void mouse_release(void); 48 | 49 | //third person style mouse look 50 | void mouseLook(double heading, double pitch); 51 | void mouseRotate(double x_angle, double y_angle); 52 | 53 | // Eye, At, Up Vectors for gluLookAt() 54 | Vector eye; 55 | Vector eyeOld; 56 | Vector eyeNew; 57 | Vector at; 58 | Vector atOld; 59 | Vector atNew; 60 | Vector up; 61 | 62 | // Current value of step counter 63 | int steps; 64 | // Maximum number of steps for a smooth movement 65 | int maxSteps; 66 | // Mode for motion 67 | bool smooth; 68 | 69 | float fov, znear, zfar, zscreen, ratio; 70 | int width, height; 71 | 72 | int mouse_active; 73 | int cursor_id; 74 | int mode; 75 | Vector mouse_centre, mouse_current; 76 | 77 | const Camera& operator= (const Camera& right); 78 | 79 | }; 80 | 81 | #endif //CAMERA_H -------------------------------------------------------------------------------- /VolViewer/src/ColourFun.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #include "ColourFun.h" 6 | 7 | /* 8 | HSV SPACE 9 | --------- 10 | Hue 0 to 360 degrees around the cone 11 | Saturation 0 to 1, distance from the centre of the cone 12 | Value 0 to 1, vertical position in the cone where 0 = black and 1 = white 13 | */ 14 | 15 | void HSVtoRGB(Vector hsv, Vector* rgb) 16 | { 17 | int i; 18 | float f, p, q, t,hTemp; 19 | 20 | if( hsv.y == 0.0 || hsv.x == -1.0) // s==0? Totally unsaturated = grey so R,G and B all equal value 21 | { 22 | rgb->x = rgb->y = rgb->z = hsv.z; 23 | return; 24 | } 25 | 26 | hTemp = hsv.x/60.0f; 27 | i = (int)floor( hTemp ); // which sector 28 | f = hTemp - i; // how far through sector 29 | p = hsv.z * ( 1 - hsv.y ); 30 | q = hsv.z * ( 1 - hsv.y * f ); 31 | t = hsv.z * ( 1 - hsv.y * ( 1 - f ) ); 32 | 33 | switch( i ) 34 | { 35 | case 0:{rgb->x = hsv.z; rgb->y = t; rgb->z = p;break;} 36 | case 1:{rgb->x = q; rgb->y = hsv.z; rgb->z = p;break;} 37 | case 2:{rgb->x = p; rgb->y = hsv.z; rgb->z = t;break;} 38 | case 3:{rgb->x = p; rgb->y = q; rgb->z = hsv.z;break;} 39 | case 4:{rgb->x = t; rgb->y = p; rgb->z = hsv.z;break;} 40 | case 5:{rgb->x = hsv.z; rgb->y = p; rgb->z = q;break;} 41 | } 42 | } 43 | 44 | void RGBtoHSV(Vector rgb, Vector* hsv) 45 | { 46 | 47 | float mn=rgb.x,mx=rgb.x; 48 | int maxVal=0; 49 | 50 | if (rgb.y > mx){ mx=rgb.y;maxVal=1;} 51 | if (rgb.z > mx){ mx=rgb.z;maxVal=2;} 52 | if (rgb.y < mn) mn=rgb.y; 53 | if (rgb.z < mn) mn=rgb.z; 54 | 55 | float delta = mx - mn; 56 | 57 | hsv->z = mx; 58 | if( mx != 0 ) 59 | hsv->y = delta / mx; 60 | else 61 | { 62 | hsv->y = 0; 63 | hsv->x = 0; 64 | return; 65 | } 66 | if (hsv->y==0.0f) 67 | { 68 | hsv->x=-1; 69 | return; 70 | } 71 | else 72 | { 73 | switch (maxVal) 74 | { 75 | case 0:{hsv->x = ( rgb.y - rgb.z ) / delta;break;} // yel < h < mag 76 | case 1:{hsv->x = 2 + ( rgb.z - rgb.x ) / delta;break;} // cyan < h < yel 77 | case 2:{hsv->x = 4 + ( rgb.x - rgb.y ) / delta;break;} // mag < h < cyan 78 | } 79 | } 80 | 81 | hsv->x *= 60; 82 | if( hsv->x < 0 ) hsv->x += 360; 83 | } 84 | 85 | void CompHSV(Vector hsv, Vector* comphsv) 86 | { 87 | if(hsv.x>=180.0f) comphsv->x = hsv.x - 180.0f; 88 | else comphsv->x = hsv.x + 180.0f; 89 | 90 | comphsv->y = hsv.y; 91 | comphsv->z = hsv.z; 92 | } 93 | -------------------------------------------------------------------------------- /VolViewer/src/ColourFun.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef COLOURFUN_H 6 | #define COLOURFUN_H 7 | 8 | #include 9 | #include "Vector.h" 10 | 11 | void HSVtoRGB(Vector hsv, Vector* rgb); 12 | void RGBtoHSV(Vector rgb, Vector* hsv); 13 | void CompHSV(Vector hsv, Vector* comphsv); 14 | 15 | #endif // COLOURFUN_H -------------------------------------------------------------------------------- /VolViewer/src/ColourMap.h: -------------------------------------------------------------------------------- 1 | #ifndef COLOURMAP_H 2 | #define COLOURMAP_H 3 | 4 | #include 5 | using namespace std; 6 | 7 | #include "Vector.h" 8 | 9 | class ColourMap 10 | { 11 | public: 12 | 13 | vector< Vector > colourmap_cols; 14 | vector< float > colourmap_vals; 15 | 16 | ColourMap(); 17 | ~ColourMap(); 18 | 19 | void clear(void); 20 | void add_entry(float val, Vector col); 21 | void delete_entry(int index); 22 | Vector get_col(int index); 23 | float get_val(int index); 24 | int getSize(void); 25 | 26 | Vector compute_colour(float min, float max, float current); 27 | 28 | const ColourMap& operator= (const ColourMap& right); 29 | }; 30 | 31 | #endif // QTCOLOURMAP_H -------------------------------------------------------------------------------- /VolViewer/src/Constant.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef CONSTANT_H 6 | #define CONSTANT_H 7 | 8 | #include 9 | 10 | const int n=1; 11 | const int FOUR_NEIGHBORS=4; 12 | const int EIGH_NEIGHBORS=8; 13 | const int TWENTYSIX_NEIGHBORS=26; 14 | //const double PI=3.141592653589793238462643; 15 | //const double SQRT2=sqrt(2); 16 | const double INFTY = 1.0e+10; 17 | const double ZERO_POSITIVE=0.000000000001;//1.0e-20; 18 | const double ZERO_NEGATIVE=-0.000000000001;//-1.0e-20; 19 | 20 | const int FILTER_SMOOTHED=1; 21 | //const int FILTER_SOBEL=2; 22 | const int FILTER_SMOOTHED_H=3; 23 | const int FILTER_SOBEL_X=4; 24 | const int FILTER_SMOOTHED_V=5; 25 | const int FILTER_SOBEL_Y=6; 26 | const int FILTER_ISOTROPIC=7; //see "fundamental of digital image processing" Jain89 27 | const int FILTER_ROBERTS=8; //see "fundamental of digital image processing" Jain89 28 | 29 | const int INFORMATION_GAIN=3; 30 | 31 | const int RED_CHANNEL=0; 32 | const int GREEN_CHANNEL=1; 33 | const int BLUE_CHANNEL=2; 34 | const int ALPHA_CHANNEL=3; 35 | const int RGBA_COLOR=4; 36 | 37 | 38 | #endif -------------------------------------------------------------------------------- /VolViewer/src/DatasetView.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #include "DatasetView.h" 6 | 7 | DatasetView::DatasetView() 8 | { 9 | numbimages = 0; 10 | current_image = 0; 11 | datafolder = ""; 12 | } 13 | DatasetView::~DatasetView() 14 | { 15 | } 16 | void DatasetView::clear(void) 17 | { 18 | numbimages = 0; 19 | current_image = 0; 20 | datafolder = ""; 21 | 22 | datasubfolders.clear(); 23 | datathumbnails.clear(); 24 | } 25 | void DatasetView::save(QString fn) 26 | { 27 | } 28 | void DatasetView::load(QString fn) 29 | { 30 | } 31 | -------------------------------------------------------------------------------- /VolViewer/src/DatasetView.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef DATASETVIEW_H 6 | #define DATASETVIEW_H 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | using namespace std; 13 | 14 | #include "VolumeRenderView.h" 15 | 16 | class DatasetView 17 | { 18 | 19 | public: 20 | 21 | int numbimages; 22 | int current_image; 23 | 24 | QString datafolder; 25 | vector< QString > datasubfolders; 26 | vector< QPixmap > datathumbnails; 27 | 28 | DatasetView(); 29 | ~DatasetView(); 30 | 31 | void clear(void); 32 | 33 | void load(QString fn); 34 | void save(QString fn); 35 | }; 36 | 37 | #endif //DATASETVIEW_H -------------------------------------------------------------------------------- /VolViewer/src/Edge.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef EDGE_H 6 | #define EDGE_H 7 | 8 | class Edge 9 | { 10 | public: 11 | int v0; 12 | int v1; 13 | 14 | Edge() 15 | { 16 | v0=0; 17 | v1=0; 18 | } 19 | Edge(int v0_, int v1_) 20 | { 21 | v0 = v0_; 22 | v1 = v1_; 23 | } 24 | 25 | Edge& operator=(const Edge& rhs) 26 | { 27 | v0 = rhs.v0; 28 | v1 = rhs.v1; 29 | 30 | return *this; 31 | } 32 | }; 33 | 34 | #endif //EDGE_H 35 | -------------------------------------------------------------------------------- /VolViewer/src/Face.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef FACE_H 6 | #define FACE_H 7 | 8 | #include "Vector.h" 9 | 10 | class Face 11 | { 12 | public: 13 | 14 | Vector *vert[3]; //pointer to 3 face vertices 15 | Vector facenormal; //the one face normal 16 | int vertindex[3]; //the three vertex indeces 17 | 18 | float uv[3][2]; 19 | 20 | Face(); 21 | 22 | void orient(void); 23 | void evaluate_face_normal(void); 24 | void inverse_map(Vector& p, float& u, float& v); 25 | void forward_map(float& u,float& v, Vector& p); 26 | float signed_area(void); 27 | int line_intersection (Vector V1, Vector V2, Vector &VHit); 28 | float perimeter(void); 29 | float area(void); 30 | }; 31 | 32 | #endif // FACE_H -------------------------------------------------------------------------------- /VolViewer/src/FilterDefinitions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef FILTERDEF_H 6 | #define FILTERDEF_H 7 | 8 | #define FILTER_MEAN 0 9 | #define FILTER_MEADIAN 1 10 | #define FILTER_GAUSSIAN 2 11 | #define FILTER_UNSHARP 3 12 | #define FILTER_SOBEL 4 13 | #define FILTER_SIEVE 5 14 | #define FILTER_COLLAPSE 6 15 | #define FILTER_INVERT 7 16 | #define FILTER_THRESHOLD 8 17 | #define FILTER_BINARIZE 9 18 | #define FILTER_DILATE 10 19 | #define FILTER_ERODE 11 20 | #define FILTER_COPY 12 21 | #define FILTER_SETOPERATOR 13 22 | #define FILTER_STRETCH 14 23 | #define FILTER_EQUALIZE 15 24 | #define FILTER_FLOODFILL 16 25 | #define FILTER_SMOOTHDIL 17 26 | #define FILTER_ADD 18 27 | #define FILTER_ARITHM 19 28 | #define FILTER_REPLACE 20 29 | #define FILTER_CLEAR 21 30 | #define FILTER_OPEN 22 31 | #define FILTER_CLOSE 23 32 | #define FILTER_MAXFLOW 24 33 | #define FILTER_PERONAMALIK 25 34 | #define FILTER_ROLLINGBALL 26 35 | #define FILTER_SWAP 27 36 | #define FILTER_COUNT 28 37 | #define FILTER_BILATERAL 29 38 | 39 | #define FILTER_GPUMEADIAN 30 40 | #define FILTER_GPUGAUSSIAN 31 41 | #define FILTER_GPUPERONAMALIK 32 42 | #define FILTER_GPUDILATE 33 43 | #define FILTER_GPUERODE 34 44 | #define FILTER_GPUSMOOTHDIL 35 45 | #define FILTER_GPUMEDIAN 36 46 | #define FILTER_GPUBILATERAL 37 47 | 48 | #endif //FILTERDEF_H 49 | -------------------------------------------------------------------------------- /VolViewer/src/Floodfill.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef FLOODFILL_H 6 | #define FLOODFILL_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | using namespace std; 14 | 15 | #include "VolumeObject.h" 16 | #include "Filter.h" 17 | #include "Point3D.h" 18 | #include "ColourFun.h" 19 | #include "Vector.h" 20 | #include "PCA.h" 21 | #include "PlaneWidgetInCube.h" 22 | 23 | #define COLOUR_RULE 0 24 | #define FILL_RULE 1 25 | #define EDGE_RULE 2 26 | #define DILATE_RULE 3 27 | #define RCOLOUR_RULE 4 28 | #define GCOLOUR_RULE 5 29 | #define BCOLOUR_RULE 6 30 | #define RCOLOURWINDOW_RULE 7 31 | #define GCOLOURWINDOW_RULE 8 32 | #define BCOLOURWINDOW_RULE 9 33 | 34 | #define CONNECT6 0 35 | #define CONNECT26 1 36 | 37 | #define VISITEDARRAY 0 38 | #define VISITEDDIRECT 1 39 | 40 | class Floodfill 41 | { 42 | 43 | public: 44 | 45 | int SRC_CHANNEL; 46 | int DST_CHANNEL; 47 | 48 | int WINDOW_SIZE; 49 | 50 | VolumeObject* volobj; 51 | 52 | int width,height,depth; 53 | bool*** visited_voxels; 54 | 55 | vector< vector< vector > > edges; 56 | 57 | vector< vector > region_indices; 58 | 59 | vector< int > region_sizes; 60 | vector< Vector > region_colours; 61 | vector region_colours_tokeep; 62 | vector regions_todelete; 63 | 64 | int regions; 65 | float scaleX, scaleY, scaleZ; 66 | int maxrecursiondepth; 67 | 68 | Floodfill(); 69 | ~Floodfill(); 70 | 71 | void progress(int i, int size); 72 | 73 | void init(int w, int h, int d, int visitedmode); 74 | void init_visited(void); 75 | void floodfill(int rule); 76 | 77 | bool isVisited(int x, int y, int z, int mode); 78 | void markVisited(int x, int y, int z, int mode); 79 | void markUnVisited(int x, int y, int z, int mode); 80 | 81 | void applyfloodfillseeded(Point3D seedpoint, int src, int dst, int window); 82 | 83 | void applyfloodfillseededsmoothed(Point3D seedpoint, int src, int dst); 84 | 85 | void delete_visited(void); 86 | 87 | int get1Dindex(Point3D p); 88 | Point3D get3Dindex(int index); 89 | 90 | void search_neighborhood(int x, int y, int z, vector* stack, int rule, int connectivity, int visitmode); 91 | 92 | bool apply_rule(int x0, int y0, int z0, int x1, int y1, int z1, int rule); 93 | int getValue(Point3D p, bool red, bool green, bool blue); 94 | 95 | void eval_connectivity(void); 96 | 97 | void apply_regiothreshold(void); 98 | void apply_result(int minsize, int maxsize); 99 | }; 100 | 101 | #endif //FLOODFILL_H -------------------------------------------------------------------------------- /VolViewer/src/FunctionEditor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef FUNCEDITOR_H 6 | #define FUNCEDITOR_H 7 | 8 | #include 9 | #include "Vector.h" 10 | #include "BSpline.h" 11 | 12 | class FunctionEditor 13 | { 14 | public: 15 | 16 | //(NB) Function space is always 0,0 -> 1,1 17 | 18 | //temp vector for delete_event 19 | Vector v; 20 | float x_min; 21 | float x_max; 22 | 23 | float size; 24 | 25 | //a delete event 26 | int delete_event; 27 | 28 | //which cp is selected 29 | int selected; 30 | 31 | //our delete zone size 32 | float delete_zone; 33 | //our repultion factor 34 | float repel_factor; 35 | 36 | //the bspline 37 | BSpline bs; 38 | 39 | FunctionEditor(); 40 | ~FunctionEditor(); 41 | 42 | void clear(void); 43 | void init(float size, int border, int offset); 44 | void reset(); 45 | 46 | void addPoint(int x, int y); 47 | void deletePoint(void); 48 | void movePoint(int x, int y); 49 | int selectPoint(int x, int y); 50 | 51 | void constrain_in_bb(void); 52 | void constrain_in_neighbours(void); 53 | void quicksortPoints(int lo, int hi); 54 | 55 | void display(void); 56 | void resize(int w, int h); 57 | const FunctionEditor& operator= (const FunctionEditor& right); 58 | }; 59 | 60 | #endif // #define FUNCEDITOR_H 61 | -------------------------------------------------------------------------------- /VolViewer/src/GL_FrameBufferObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef FRAME_BUFFER_OBJECT_H 6 | #define FRAME_BUFFER_OBJECT_H 7 | //#include 8 | #include 9 | #include "glext.h" 10 | 11 | #define FBO_DEPTH_16 0x00000001 12 | #define FBO_DEPTH_24 0x00000002 13 | #define FBO_DEPTH_32 0x00000004 14 | #define FBO_STENCIL 0x00000010 15 | 16 | #include "GL_Ext.h" 17 | 18 | class GL_FrameBufferObject 19 | { 20 | public: 21 | GLuint width, 22 | height, 23 | frameBufferIndex, 24 | depthBufferIndex, 25 | stencilBufferIndex; 26 | 27 | 28 | GL_Ext* glext; 29 | GL_FrameBufferObject(); 30 | ~GL_FrameBufferObject(); 31 | 32 | bool initialize(int width, int height, int format = 0); 33 | bool initialize(int width, int height, GLenum depthformat, GLuint colid, GLuint depthid); 34 | bool checkFrameBufferStatus(); 35 | 36 | void attachTexture( GLenum attachment, GLenum texType, GLuint texId); 37 | void switchTarget(int textureID); 38 | void bind(); 39 | void bind(GLuint index); 40 | void stop(); 41 | 42 | GLuint getHeight(); 43 | GLuint getWidth(); 44 | }; 45 | 46 | #endif -------------------------------------------------------------------------------- /VolViewer/src/GL_ShaderObj.h: -------------------------------------------------------------------------------- 1 | #ifndef GL_SHADEROBJ_H 2 | #define GL_SHADEROBJ_H 3 | 4 | //#include 5 | #include 6 | #include "glext.h" 7 | #include 8 | #include 9 | #include 10 | 11 | #include "GL_Ext.h" 12 | 13 | typedef enum 14 | { 15 | EVertexShader, 16 | EFragmentShader, 17 | } EShaderType; 18 | 19 | class GL_ShaderOBJ 20 | { 21 | public: 22 | 23 | GL_ShaderOBJ(); 24 | ~GL_ShaderOBJ(); 25 | 26 | GL_Ext* glext; 27 | GLhandleARB ProgramObject; 28 | GLhandleARB VertexShaderObject; 29 | GLhandleARB FragmentShaderObject; 30 | 31 | void enable(void); 32 | void disable(void); 33 | 34 | void shader_info(GLhandleARB object); 35 | int shader_size(const char *fileName, EShaderType shaderType); 36 | int read_shader(const char *fileName, EShaderType shaderType, char *shaderText, int size); 37 | int read_shaderSRC(const char *fileName, GLcharARB **vertexShader, GLcharARB **fragmentShader); 38 | int install_shader(const GLcharARB *vertexShaderSRC, const GLcharARB *fragmentShaderSRC); 39 | GLint GetUniLoc(const GLcharARB *name); // get location of a variable 40 | GLint GetAttribLoc(const GLcharARB *name); 41 | void BindAttrib(int loc, const GLcharARB *name); 42 | 43 | void sendUniform1f(char* varname, GLfloat v0); 44 | void sendUniform2f(char* varname, GLfloat v0, GLfloat v1); 45 | void sendUniform3f(char* varname, GLfloat v0, GLfloat v1, GLfloat v2); 46 | void sendUniform4f(char* varname, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); 47 | 48 | void sendUniform1fv(char* varname, GLsizei count, GLfloat* value); 49 | void sendUniform2fv(char* varname, GLsizei count, GLfloat* value); 50 | void sendUniform3fv(char* varname, GLsizei count, GLfloat* value); 51 | void sendUniform4fv(char* varname, GLsizei count, GLfloat* value); 52 | 53 | void sendUniform1i(char* varname, GLint v0); 54 | void sendUniform2i(char* varname, GLint v0, GLint v1); 55 | void sendUniform3i(char* varname, GLint v0, GLint v1, GLint v2); 56 | void sendUniform4i(char* varname, GLint v0, GLint v1, GLint v2, GLint v3); 57 | 58 | void sendUniform1iv(char* varname, GLsizei count, GLint* value); 59 | void sendUniform2iv(char* varname, GLsizei count, GLint* value); 60 | void sendUniform3iv(char* varname, GLsizei count, GLint* value); 61 | void sendUniform4iv(char* varname, GLsizei count, GLint* value); 62 | 63 | void sendUniformMatrix2fv(char* varname, GLsizei count, GLboolean transpose, GLfloat *value); 64 | void sendUniformMatrix3fv(char* varname, GLsizei count, GLboolean transpose, GLfloat *value); 65 | void sendUniformMatrix4fv(char* varname, GLsizei count, GLboolean transpose, GLfloat *value); 66 | 67 | }; 68 | 69 | #endif //GL_SHADEROBJ_H -------------------------------------------------------------------------------- /VolViewer/src/Gaussian.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef GAUSSIAN_H 6 | #define GAUSSIAN_H 7 | 8 | #pragma warning(disable:4786) 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | using namespace std; 17 | 18 | #define PI 3.141592653589793238462643383279f 19 | #define TWOPI 6.283185307179586476925286766558f 20 | 21 | 22 | class Gaussian 23 | { 24 | 25 | public: 26 | 27 | //(NB) for a guassian function 28 | // the integral from +infity to -infinity is always == 1.0 29 | vector fmask1d; 30 | vector mask1d; 31 | vector< vector > mask2d; 32 | vector< vector< vector > > mask3d; 33 | 34 | //kernel size 35 | int size; 36 | 37 | //the standard deviation of our gaussian (spread) 38 | double sigma; 39 | 40 | //this really is the full width at half height 41 | double half_width; 42 | 43 | Gaussian(); 44 | ~Gaussian(); 45 | 46 | void clear_all(void); 47 | 48 | void eval_half_width(void); 49 | void eval_sigma(int size); 50 | 51 | double gaussian1d(double x); 52 | double gaussian2d(double x, double y); 53 | double gaussian3d(double x, double y, double z); 54 | 55 | const vector gaussianmask1Df(float s, float size); 56 | const vector gaussianmask1D(double sigma, double size); 57 | const vector< vector > gaussianmask2D(double sigma, double size); 58 | const vector< vector< vector > > gaussianmask3D(double sigma, double size); 59 | 60 | void display1d(void); 61 | void display2d(void); 62 | void display3d(void); 63 | }; 64 | 65 | #endif //GAUSSIAN_H -------------------------------------------------------------------------------- /VolViewer/src/Global.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #include "Global.h" 6 | 7 | float divsize = 16; 8 | int count_ = 0; 9 | int progress_iter_steps = 0; 10 | int progress_iter=0; 11 | 12 | #define COW 2172 13 | char* moo = "MO "; 14 | 15 | //ascii progressbar, 16 | //takes current value, size, and number of bars 17 | void progress(int i, int size) 18 | { 19 | //int j; 20 | //j = COW-moo[i&3],fputs((const char*)&j,stderr); 21 | 22 | /*float prog = ( (float)(i+1)/(float)(size) )*100.0f; 23 | printf("\r\r Progress = %.2f", prog);*/ 24 | 25 | if(i==0) 26 | { 27 | divsize = 16; 28 | count_=0; 29 | progress_iter_steps = int(((float)size/(float)divsize)+0.5); 30 | progress_iter=0; 31 | } 32 | 33 | QString t; 34 | int k; 35 | 36 | if(progress_iter==i) 37 | { 38 | count_++; 39 | 40 | t="["; 41 | 42 | for(k=0; k<(count_); k++) 43 | t+="*"; 44 | 45 | for(k=0; k9999.0f) 78 | { 79 | val /= 10000.0; 80 | numb.setNum(val); 81 | numb += " c"; 82 | } 83 | else if(val>999.0f) 84 | { 85 | val /= 1000.0; 86 | numb.setNum(val); 87 | numb += " m"; 88 | } 89 | else 90 | { 91 | numb.setNum(val); 92 | numb += QChar(0x00B5);//QString::fromStdString (L" \u00B5"); 93 | } 94 | numb += "m"; 95 | 96 | return numb; 97 | } -------------------------------------------------------------------------------- /VolViewer/src/Global.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef GLOBAL_H 6 | #define GLOBAL_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | using namespace std; 13 | 14 | void progress(int i, int size); 15 | QString setUnit(float val); 16 | 17 | #endif //GLOBAL_H 18 | -------------------------------------------------------------------------------- /VolViewer/src/LICENSE.url.URL: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=http://creativecommons.org/licenses/by-nc-nd/3.0/ 3 | -------------------------------------------------------------------------------- /VolViewer/src/MarchingCubes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef MCUBES_H 6 | #define MCUBES_H 7 | 8 | //#include "Global.h" 9 | #include "ColourFun.h" 10 | #include "Vector.h" 11 | #include "Face.h" 12 | #include "Mesh.h" 13 | #include "VolumeObject.h" 14 | #include "Filter.h" 15 | #include "Gaussian.h" 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | using namespace std; 26 | 27 | class MCubes 28 | { 29 | public: 30 | 31 | int helpA; 32 | int helpB; 33 | 34 | Q3ProgressDialog* progressbar; 35 | VolumeObject* volobj; 36 | 37 | bool selected_channels[3]; 38 | int r,g,b; 39 | 40 | unsigned char* tfunc_lookup; 41 | 42 | //our mesh object 43 | Mesh* mesh; 44 | 45 | //we use this to store gaussians, avoid recompute... 46 | map gaussianvalues_map; 47 | 48 | //we use stl::set to make sure 49 | //no duplicate verts & tris are added 50 | Vector last_added_vert; 51 | set verts_set; 52 | //vector verts_set_size_cube; 53 | 54 | int gaussian_kernel_radius; 55 | vector< vector< vector > > mask; 56 | vector < double > mask1d; 57 | 58 | GLint iDataSetSize; 59 | GLfloat fStepSize; 60 | GLfloat fTargetValue; 61 | 62 | int finished; 63 | 64 | MCubes (); 65 | 66 | void progress(int i, int size); 67 | 68 | void clear(void); 69 | 70 | GLfloat fGetOffset(GLfloat fValue1, GLfloat fValue2, GLfloat fValueDesired); 71 | 72 | GLfloat fSample(GLfloat x, GLfloat y, GLfloat z, int gaussflag); 73 | GLvoid vGetNormal(Vector &rfNormal, GLfloat fX, GLfloat fY, GLfloat fZ, int gaussflag); 74 | 75 | GLvoid vMarchCube(GLfloat x, GLfloat y, GLfloat z, GLfloat fScale, int gaussflag); 76 | 77 | GLvoid vMarchingCubes(bool* channels, int qual, int value, unsigned char* tfunc); 78 | GLvoid vMarchingCubes(bool* channels, int qual, int value, unsigned char* tfunc, float size, float sigma); 79 | }; 80 | 81 | #endif // MCUBES_H -------------------------------------------------------------------------------- /VolViewer/src/Matrix4x4.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef MATRIX4X4_H 6 | #define MATRIX4X4_H 7 | 8 | #include 9 | using namespace std; 10 | 11 | #include "Vector.h" 12 | 13 | class Matrix4x4 14 | { 15 | public: 16 | 17 | float m[16]; 18 | 19 | Matrix4x4(); 20 | ~Matrix4x4(); 21 | 22 | void identity(void); 23 | void inverse(void); 24 | void transpose(void); 25 | void find_rotation(Vector v1, Vector v2); 26 | void find_rotationfromaxis(Vector fromx, Vector fromy, Vector fromz, Vector tox, Vector toy, Vector toz); 27 | void find_rotation_from_euler(float anglex, float angley, float anglez); 28 | 29 | Matrix4x4& operator= (const Matrix4x4& m2); 30 | Matrix4x4& operator= (float m2[16]); 31 | }; 32 | 33 | Matrix4x4 operator* (const Matrix4x4& m1, const Matrix4x4& m2 ); 34 | Vector operator* (const Matrix4x4& m1, const Vector& v ); 35 | Matrix4x4 operator+ (const Matrix4x4& m1, const Matrix4x4& m2 ); 36 | ostream& operator<<(ostream& output, const Matrix4x4& m1); 37 | 38 | #endif //MATRIX4X4_H -------------------------------------------------------------------------------- /VolViewer/src/MeasureDefinitions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef MEASUREDEFINITIONS_H 6 | #define MEASUREDEFINITIONS_H 7 | 8 | #define MEASURE_DRAWMODE_NONE -1 9 | #define MEASURE_DRAWMODE_POINTS 0 10 | #define MEASURE_DRAWMODE_LINES 1 11 | #define MEASURE_DRAWMODE_MAGNETLINE 2 12 | #define MEASURE_DRAWMODE_CROP 3 13 | 14 | #define MEASURE_EDIT_NONE -1 15 | #define MEASURE_EDIT_VERTS 0 16 | #define MEASURE_EDIT_EDGES 1 17 | #define MEASURE_EDIT_FACES 2 18 | 19 | #define MEASURE_VIEW_NONE -1 20 | #define MEASURE_VIEW_VERTS 0 21 | #define MEASURE_VIEW_EDGES 1 22 | #define MEASURE_VIEW_FACES 2 23 | 24 | #endif //MEASUREDEFINITIONS_H 25 | -------------------------------------------------------------------------------- /VolViewer/src/Mesh.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef MESH_H 6 | #define MESH_H 7 | 8 | #define MESH_CENTRE 2 9 | #define MESH_VERTEX_NORMALS 3 10 | #define MESH_FACE_NORMALS 4 11 | #define MESH_TEXCOORDS 5 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | using namespace std; 21 | 22 | #include "glext.h" 23 | #include "Vector.h" 24 | #include "Face.h" 25 | #include "GL_Ext.h" 26 | 27 | class Mesh 28 | { 29 | public: 30 | GL_Ext* glextensions; 31 | 32 | bool has_vbo; 33 | unsigned int vbo1_name; 34 | unsigned int vbo2_name; 35 | unsigned int vbo3_name; 36 | GLuint* vbo_indices; 37 | GLfloat* vbo_verts; 38 | GLfloat* vbo_norms; 39 | 40 | int nv, nf; //number of vertices / faces 41 | 42 | vector vert; //the vertices array 43 | vector vertnorm; //the normals array 44 | vector vertcol; //the colours array 45 | vector texCoords; //the texcoord array 46 | vector faces; //the faces pointer array 47 | vector localfaces; //the faces array 48 | 49 | //----------------------------------------------------- 50 | 51 | Mesh(); 52 | Mesh(const Mesh& m); 53 | ~Mesh(); 54 | 55 | void reset(void); 56 | void set_numverts(int n); 57 | void set_numfaces(int n); 58 | 59 | bool load_OBJ_data(const char *Filename); 60 | bool load_NET_data(const char *Filename); 61 | void set_data(const vector& newVerts, 62 | const vector& newNorms, 63 | const vector& newColours, 64 | const vector& newTexcoords, 65 | const vector >& newFaces); 66 | 67 | bool save_NET_data(const char *Filename); 68 | bool save_OBJ_data(const char *Filename); 69 | bool save_MARKCANVAS_data(const char *Filename); 70 | 71 | void r_vbo(GLenum surface); 72 | void init_vbo(void); 73 | 74 | //utility functions 75 | void scale(float size); 76 | void scalev(Vector scalefactor); 77 | 78 | //evaluators 79 | void evaluate(int ...); 80 | void evaluate_centre(void ); 81 | void evaluate_normals(void); 82 | void evaluate_texture_coords(void); 83 | 84 | //Render Modes 85 | void r_normal(GLenum surface, GLint texname); 86 | 87 | //Debug 88 | void display_normals(void); 89 | void display_vertex_normal(int x, int y); 90 | 91 | const Mesh& operator= (const Mesh& right); 92 | 93 | }; 94 | 95 | #endif // MESH_H -------------------------------------------------------------------------------- /VolViewer/src/MeshListObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef MESHLISTOBJECT_H 6 | #define MESHLISTOBJECT_H 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | #include "Vector.h" 14 | #include "Mesh.h" 15 | #include "Tokenizer.h" 16 | 17 | class MeshListObject 18 | { 19 | public: 20 | Q3ProgressDialog* progressbar; 21 | GL_Ext* glextensions; 22 | 23 | vector< QString > names; 24 | vector colours; 25 | vector< Mesh > meshes; 26 | vector< int > qualities; 27 | vector< int > values; 28 | vector< float > smoothsize; 29 | vector< float > smoothsigma; 30 | vector< int > clipstate; 31 | 32 | MeshListObject(); 33 | ~MeshListObject(); 34 | 35 | void clear_all(void); 36 | 37 | Mesh* new_mesh(void); 38 | 39 | void add(QString name, Vector col,int qual, int val, float smoothsize, float smoothsigma, int clipstate); 40 | void del(QString name); 41 | void copy(QString name); 42 | 43 | void get(QString name, int* quality, int* value, float* smoothsize, float* smoothsigma, Vector* col, int* nv, int* nf, int* clipstat); 44 | int set(QString oldname, QString name, int quality, int value, float smoothsize, float smoothsigma, Vector col, int clpst); 45 | 46 | void save_obj(QString filename, int j); 47 | void save(QString filename); 48 | void load(QString filename); 49 | }; 50 | 51 | #endif // MESHLISTOBJECT_H -------------------------------------------------------------------------------- /VolViewer/src/MyDefines.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef MYDEFINES_H 6 | #define MYDEFINES_H 7 | 8 | //#define BIOPTONICS_SUPPORT 9 | //#define OMERO_SUPPORT 10 | //#define LIBTIFF_SUPPORT 11 | //#define BROWSER5D_SUPPORT 12 | //#define OPENCL_SUPPORT 13 | 14 | #ifdef OMERO_SUPPORT 15 | #include 16 | using namespace Ice; 17 | #endif //OMERO_SUPPORT 18 | 19 | #endif //MYDEFINES_H 20 | -------------------------------------------------------------------------------- /VolViewer/src/MyMath.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #include "MyMath.h" 6 | 7 | float roundup(float number, int decplaces) 8 | { 9 | float dp=1; 10 | 11 | for(int i=0; i 9 | #include 10 | #include 11 | 12 | //using namespace std; 13 | 14 | #define PI 3.141592653589793238462643383279f 15 | #define TWOPI 6.283185307179586476925286766558f 16 | 17 | float roundup(float number, int decplaces); 18 | float randomFloat(float min, float max); 19 | 20 | /* 21 | float fcos(float a); 22 | float fsin(float a); 23 | #define cosf(x) ((float)fcos((x))) 24 | #define sinf(x) ((float)fsin((x))) 25 | */ 26 | 27 | 28 | #endif // MATH_H -------------------------------------------------------------------------------- /VolViewer/src/OpenCLExecuter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef OPENCL_EXEC_H 6 | #define OPENCL_EXEC_H 7 | 8 | #include "MyDefines.h" 9 | 10 | #ifdef OPENCL_SUPPORT 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include "glext.h" 19 | 20 | using namespace std; 21 | 22 | // All OpenCL headers 23 | #if defined (__APPLE__) || defined(MACOSX) 24 | #include 25 | #define GL_SHARING_EXTENSION "cl_APPLE_gl_sharing" 26 | #else 27 | #include 28 | #define GL_SHARING_EXTENSION "cl_khr_gl_sharing" 29 | #endif 30 | 31 | #include "Timer.h" 32 | #include "MyMath.h" 33 | #include "VolumeObject.h" 34 | #include "Gaussian.h" 35 | #include "OpenCLWrapper.h" 36 | 37 | class OpenCLExecuter 38 | { 39 | public: 40 | 41 | OpenCLWrapper* ocl_wrapper; // OpenCL wrapper class 42 | cl_program cpProgram; // OpenCL program 43 | 44 | VolumeObject* volobj; // Volume object 45 | 46 | int filter_width; 47 | vector < float > filter_kernel; 48 | 49 | OpenCLExecuter(); 50 | ~OpenCLExecuter(); 51 | 52 | char* ocl_file_contents(const char *filename, int *length); 53 | void printBuildLog(cl_program* prog); 54 | 55 | void ocl_filter(int src_chan); //own context 56 | void ocl_filter_multi(void); //own context, multi GPU 57 | void ocl_filter_shared(void); //shared gl/cl context, single device 58 | 59 | void ocl_init_progam(string fn); //load and compile the cl program 60 | 61 | void ocl_filter(unsigned char* src_array, unsigned char* dst_array, int w, int h, int d); 62 | 63 | //own context, 3D decomposed as 3 x 1D gaussians 64 | void ocl_filterGaussian_init(float sigma, float size); 65 | void ocl_filterGaussian(unsigned char* src_array, unsigned char* dst_array, int w, int h, int d); 66 | 67 | void ocl_filterBoundingBox(int channel, int window_size); 68 | 69 | void ocl_filterBilateral(int spatial, float range, unsigned char* src_array, unsigned char* dst_array, int w, int h, int d); 70 | 71 | void ocl_filterPeronaMalik(float lambda, float dT, unsigned char* src_array, unsigned char* dst_array, int w, int h, int d); 72 | 73 | void ocl_parrallelReduction(void); 74 | 75 | }; 76 | 77 | #endif //OPENCL_SUPPORT 78 | 79 | #endif //OPENCL_EXEC_H 80 | -------------------------------------------------------------------------------- /VolViewer/src/OpenCLWrapper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef OPENCL_WRAP_H 6 | #define OPENCL_WRAP_H 7 | 8 | #include "MyDefines.h" 9 | 10 | #ifdef OPENCL_SUPPORT 11 | //#pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable 12 | 13 | #include 14 | #include 15 | using namespace std; 16 | 17 | #include "glext.h" 18 | 19 | // All OpenCL headers 20 | #if defined (__APPLE__) || defined(MACOSX) 21 | #include 22 | #define GL_SHARING_EXTENSION "cl_APPLE_gl_sharing" 23 | #else 24 | #include 25 | #define GL_SHARING_EXTENSION "cl_khr_gl_sharing" 26 | #endif 27 | 28 | class OpenCLWrapper 29 | { 30 | public: 31 | 32 | OpenCLWrapper(); 33 | ~OpenCLWrapper(); 34 | 35 | int platform_index; 36 | vector< string > platform_list; 37 | 38 | cl_platform_id* platformIDs; // The available OpenCL platforms 39 | 40 | cl_uint num_platforms; // Number of OpenCL platforms 41 | cl_platform_id platformUsed; // OpenCL platform 42 | cl_context context; // OpenCL context 43 | cl_device_id* devices; // OpenCL device list 44 | cl_command_queue commandQue; // OpenCL command queue 45 | cl_uint numDevices; // Number of OpenCL devices 46 | unsigned int deviceUsed; // OpenCL device used 47 | cl_int err; // debugging variables 48 | 49 | cl_int get_PlatformID(cl_platform_id* clSelectedPlatformID); //Get the avialable OpenCL platforms 50 | void init_PlatformAndDevices(void); //Init our Platform and Device list (only GPUs atm) 51 | void create_NewContext(void); //Create a new OpenCL context 52 | void create_NewMultiDeviceContext(void); //Create a new OpenCL multi-device context 53 | void create_SharedContext(void); //Create a shared OpenGL/OpenCL context (so can share objects) 54 | void print_DeviceInfo(void); //Prints general information about the used device 55 | 56 | void switch_Platform(int i); //Switch the current platform 57 | const char* get_error(cl_int error); 58 | }; 59 | 60 | #endif //OPENCL_SUPPORT 61 | 62 | #endif //OPENCL_WRAP_H -------------------------------------------------------------------------------- /VolViewer/src/PCA.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef PCA_H 6 | #define PCA_H 7 | 8 | #include 9 | #include 10 | #include 11 | using namespace std; 12 | 13 | #include "Vector.h" 14 | 15 | //Principle component class 16 | //for the time being, covariance matrix limited to max 3d data 17 | //as is hardcoded in... (yuck) 18 | 19 | class PCA 20 | { 21 | 22 | public: 23 | 24 | //our 3D data 25 | vector< Vector > bounding_box; 26 | vector< Vector > data; 27 | vector< Vector > aligned_data; 28 | vector< Vector > aligned_data2; 29 | 30 | //statistical of the data 31 | float originalmeanx, originalmeany, originalmeanz; 32 | float meanx, meany, meanz; 33 | float variancex, variancey, variancez; 34 | float covariance; 35 | vector< vector > covariance_matrix; 36 | vector< Vector > eigenvectors; 37 | 38 | PCA(); 39 | ~PCA(); 40 | 41 | void reset(void); 42 | void gen_rnd1D(int size); 43 | void gen_rnd2D(int size); 44 | void gen_rnd3D(int size); 45 | 46 | void eval_meanX(void); 47 | void eval_meanY(void); 48 | void eval_meanZ(void); 49 | 50 | void eval_varX(void); 51 | void eval_varY(void); 52 | void eval_varZ(void); 53 | 54 | void eval_covariance(void); 55 | void eval_covariance_matrix(void); 56 | 57 | void eval_PCA(void); 58 | void eigen(int mv, int n, long double* a, long double* r) const; 59 | void eval_eigenvectors(void); 60 | void eval_aligned_data(void); 61 | void eval_boundingbox(float xscale, float yscale, float zscale); 62 | void eval_scaled_eigensvectors(float xscale, float yscale, float zscale); 63 | 64 | void display(void); 65 | 66 | }; 67 | 68 | #endif //PCA_H 69 | -------------------------------------------------------------------------------- /VolViewer/src/PeronaMalikFlow.h: -------------------------------------------------------------------------------- 1 | #ifndef PERONAMALIK_H 2 | #define PERONAMALIK_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | using namespace std; 9 | 10 | class PeronaMalikFlow 11 | { 12 | public: 13 | 14 | double dx, dy, dz, dd, dh, dc; 15 | 16 | float lambda; 17 | float lambda2; 18 | 19 | int offset; 20 | 21 | unsigned char* data; 22 | int width; 23 | int height; 24 | int depth; 25 | 26 | PeronaMalikFlow(); 27 | ~PeronaMalikFlow(); 28 | 29 | void init_data2d(int w, int h); 30 | void set_dataValue(int index, float val); 31 | 32 | void init_data3d(int w, int h, int d, unsigned char* imgdata); 33 | 34 | float computeDiffusion(float v); 35 | 36 | float compute2d_4connect(int x, int y); 37 | float compute2d_8connect(int x, int y); 38 | 39 | float compute3d_26connect(int x, int y, int z); 40 | float compute3d_6connect(int x, int y, int z); 41 | 42 | void peronaMalikOperator2d(float dt, int nbiter); 43 | void peronaMalikOperator3d(float dt, int nbiter, int chan, int dim); 44 | }; 45 | 46 | #endif //PERONAMALIK_H 47 | -------------------------------------------------------------------------------- /VolViewer/src/PlaneWidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef PLANEWIDGET_H 6 | #define PLANEWIDGET_H 7 | #include 8 | #include 9 | #include 10 | 11 | using namespace std; 12 | 13 | #include "Vector.h" 14 | #include "ArcBall.h" 15 | #include "Matrix4x4.h" 16 | 17 | class PlaneWidget 18 | { 19 | public: 20 | 21 | //normal of the plane 22 | Vector normal; 23 | 24 | //centre of the plane 25 | Vector centre; 26 | 27 | //equation of the plane 28 | //ax + by + cz + d = 0 29 | GLdouble plane_equation[4]; 30 | 31 | //camera manip helpers 32 | ArcBall arcball; 33 | Vector glob_mouse; 34 | 35 | float angleX; 36 | float angleY; 37 | float translate; 38 | 39 | Vector perpX; 40 | Vector perpY; 41 | 42 | Vector axisX; 43 | Vector axisY; 44 | Vector axisZ; 45 | 46 | Matrix4x4 rot_mat; 47 | 48 | Vector v1; 49 | Vector v2; 50 | Vector v3; 51 | Vector v4; 52 | 53 | Vector _v1; 54 | Vector _v2; 55 | Vector _v3; 56 | Vector _v4; 57 | 58 | PlaneWidget(); 59 | PlaneWidget(Vector _v1, Vector _v2, Vector _v3, Vector _v4, int mode); 60 | 61 | ~PlaneWidget(); 62 | 63 | void mouseMove(Vector mousepos); 64 | void mousePress(Vector mousepos, int type); 65 | void mouseRelease(); 66 | 67 | void display(int surface); 68 | void display_points(); 69 | void display3d(int surface); 70 | void eval_planeequation(void); 71 | void translate_by_vec(Vector t); 72 | 73 | const PlaneWidget& operator= (const PlaneWidget& right); 74 | }; 75 | 76 | #endif // PLANEWIDGET_H -------------------------------------------------------------------------------- /VolViewer/src/Point3D.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef POINT3D_H 6 | #define POINT3D_H 7 | 8 | class Point3D 9 | { 10 | public: 11 | unsigned int x,y,z; 12 | Point3D() 13 | { 14 | x=0; 15 | y=0; 16 | z=0; 17 | } 18 | 19 | Point3D(int x1, int y1, int z1) 20 | { 21 | x=x1; 22 | y=y1; 23 | z=z1; 24 | } 25 | }; 26 | 27 | #endif //POINT3D_H -------------------------------------------------------------------------------- /VolViewer/src/QtCameraEditorDialogue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #include 6 | #include 7 | #include 8 | //Added by qt3to4: 9 | #include 10 | //#include //style 11 | 12 | #include 13 | 14 | #include "QtCameraEditorDialogue.h" 15 | 16 | QtCameraEditorDialogue::QtCameraEditorDialogue(QWidget * parent, const char * name, bool modal, Qt::WFlags f) 17 | :Q3TabDialog(parent, name, modal,f) 18 | { 19 | setCaption("Camera Editor"); 20 | //setIcon( QPixmap( "icons/config.png" )); 21 | 22 | build_layout(); 23 | } 24 | 25 | QtCameraEditorDialogue::~QtCameraEditorDialogue(void) 26 | { 27 | } 28 | 29 | void QtCameraEditorDialogue::reset(void) 30 | { 31 | } 32 | 33 | void QtCameraEditorDialogue::build_layout(void) 34 | { 35 | //Create the tabs 36 | 37 | camerasettings_tab = new QtCameraSettingsWidget(this, "camerasettings_tab"); 38 | camerasettings_tab->create(); 39 | 40 | addTab(camerasettings_tab, "Camera Settings"); 41 | 42 | //only add a close button 43 | setOkButton(NULL); 44 | setCancelButton("Close"); 45 | } 46 | 47 | void QtCameraEditorDialogue::rebuild_tabs(void) 48 | { 49 | // rendersettings_tab->rebuild(); 50 | } 51 | void QtCameraEditorDialogue::reset_event(void) 52 | { 53 | } 54 | void QtCameraEditorDialogue::apply_event(void) 55 | { 56 | 57 | } 58 | -------------------------------------------------------------------------------- /VolViewer/src/QtCameraEditorDialogue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QTCAMEDITOR_H 6 | #define QTCAMEDITOR_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include "QtCameraSettingsWidget.h" 13 | 14 | class QtCameraEditorDialogue: public Q3TabDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | 20 | QtCameraSettingsWidget* camerasettings_tab; 21 | 22 | QtCameraEditorDialogue(QWidget * parent=0, const char * name=0, bool modal=FALSE, Qt::WFlags f=0); 23 | ~QtCameraEditorDialogue(); 24 | 25 | void reset(void); 26 | void build_layout(void); 27 | void rebuild_tabs(void); 28 | 29 | private slots: 30 | void reset_event(void); 31 | void apply_event(void); 32 | 33 | signals: 34 | void reset_signal(void); 35 | }; 36 | 37 | #endif // QTCAMEDITOR_H -------------------------------------------------------------------------------- /VolViewer/src/QtCameraSettingsWidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QtCameraSettingsWidget_H 6 | #define QtCameraSettingsWidget_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include "Vector.h" 29 | #include "ColourFun.h" 30 | 31 | class QtCameraSettingsWidget: public QWidget 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | 37 | Q3ButtonGroup* perpectivesettings_grp; 38 | QPushButton* camera_ortho_pb; 39 | QPushButton* camera_persp_pb; 40 | 41 | //perpective FOV 42 | QLabel* camerafov_lb; 43 | QSlider* camerafov_slider; 44 | int camerafov; 45 | 46 | QLabel* camerastep_lb; 47 | QSlider* camerastep_slider; 48 | int camerastep; 49 | 50 | QtCameraSettingsWidget(QWidget* parent, const char* name); 51 | ~QtCameraSettingsWidget(); 52 | 53 | void create(void); 54 | void reset(void); 55 | void rebuild(void); 56 | void apply(void); 57 | void reload(void); 58 | 59 | public slots: 60 | void camerasettings_setmode_slot(int id, int fov); 61 | 62 | private slots: 63 | void camerasettings_step_slot(int val); 64 | void camerasettings_fov_slot(int val); 65 | void camerasettings_mode_slot(int id); 66 | signals: 67 | void camerasettings_mode_signal(int id); 68 | void camerasettings_fov_signal(int fov); 69 | void camerasettings_step_signal(int step); 70 | 71 | }; 72 | 73 | #endif // QtStereoSettingsWidget_H 74 | -------------------------------------------------------------------------------- /VolViewer/src/QtClippingEditorDialogue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #include 6 | #include 7 | #include 8 | //Added by qt3to4: 9 | #include 10 | //#include //style 11 | 12 | #include 13 | 14 | #include "QtClippingEditorDialogue.h" 15 | 16 | QtClippingEditorDialogue::QtClippingEditorDialogue(QWidget * parent, const char * name, bool modal, Qt::WFlags f) 17 | :Q3TabDialog(parent, name, modal,f) 18 | { 19 | setCaption("Clipping Editor"); 20 | //setIcon( QPixmap( "Icons/Simple/cut.png" )); 21 | build_layout(); 22 | } 23 | 24 | QtClippingEditorDialogue::~QtClippingEditorDialogue(void) 25 | { 26 | } 27 | 28 | void QtClippingEditorDialogue::reset(void) 29 | { 30 | } 31 | 32 | void QtClippingEditorDialogue::build_layout(void) 33 | { 34 | cliptab = new QtCLippingWidget(this, "cliptab"); 35 | cliptab->create(); 36 | 37 | //our tab pages 38 | addTab(cliptab, "Clipping"); 39 | 40 | //some buttons 41 | // setApplyButton ("Apply"); 42 | // setDefaultButton("Undo"); 43 | // setHelpButton("Reload"); 44 | setCancelButton("Close"); 45 | setOkButton(0); 46 | 47 | // connect(this, SIGNAL(applyButtonPressed()), this, SLOT(apply_event())); 48 | // connect(this, SIGNAL(defaultButtonPressed()), this, SLOT(undo_event())); 49 | // connect(this, SIGNAL(helpButtonPressed()), this, SLOT(reload_event())); 50 | connect(this, SIGNAL(cancelButtonPressed()), this, SLOT(close_event())); 51 | } 52 | 53 | void QtClippingEditorDialogue::rebuild_tabs(void) 54 | { 55 | } 56 | void QtClippingEditorDialogue::undo_event(void) 57 | { 58 | emit undo_signal(); 59 | } 60 | void QtClippingEditorDialogue::close_event(void) 61 | { 62 | reset(); 63 | cliptab->exit(); 64 | 65 | //emit close_signal(); 66 | } 67 | void QtClippingEditorDialogue::reload_event(void) 68 | { 69 | emit reload_signal(); 70 | } 71 | void QtClippingEditorDialogue::apply_event(void) 72 | { 73 | if(cliptab==currentPage()) 74 | { 75 | emit clip_signal(); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /VolViewer/src/QtClippingEditorDialogue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QTCLIPEDITOR_H 6 | #define QTCLIPEDITOR_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include "QtCLippingWidget.h" 13 | 14 | class QtClippingEditorDialogue: public Q3TabDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | //pointer to our main window 20 | QtCLippingWidget* cliptab; 21 | 22 | QtClippingEditorDialogue(QWidget * parent=0, const char * name=0, bool modal=FALSE, Qt::WFlags f=0); 23 | ~QtClippingEditorDialogue(); 24 | 25 | void reset(void); 26 | void build_layout(void); 27 | void rebuild_tabs(void); 28 | 29 | private slots: 30 | void undo_event(void); 31 | void close_event(void); 32 | void reload_event(void); 33 | void apply_event(void); 34 | 35 | signals: 36 | void undo_signal(void); 37 | void close_signal(void); 38 | void reload_signal(void); 39 | void clip_signal(void); 40 | }; 41 | 42 | #endif // QTCLIPEDITOR_H -------------------------------------------------------------------------------- /VolViewer/src/QtCropEditorDialogue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #include 6 | #include 7 | #include 8 | //Added by qt3to4: 9 | #include 10 | //#include //style 11 | 12 | #include 13 | 14 | #include "QtCropEditorDialogue.h" 15 | 16 | QtCropEditorDialogue::QtCropEditorDialogue(QWidget * parent, const char * name, bool modal, Qt::WFlags f, QString app_path) 17 | :Q3TabDialog(parent, name, modal,f) 18 | { 19 | appPath = app_path; 20 | setCaption("Crop Editor"); 21 | //setIcon( QPixmap( "Icons/crop.png" )); 22 | build_layout(); 23 | } 24 | 25 | QtCropEditorDialogue::~QtCropEditorDialogue(void) 26 | { 27 | } 28 | 29 | void QtCropEditorDialogue::reset(void) 30 | { 31 | croptab->reset(); 32 | } 33 | 34 | void QtCropEditorDialogue::build_layout(void) 35 | { 36 | croptab = new QtCropWidget(this, "filttab", appPath); 37 | croptab->create(); 38 | 39 | //our tab pages 40 | addTab(croptab, "Crop"); 41 | 42 | //some buttons 43 | setCancelButton("Close"); 44 | setOkButton(0); 45 | 46 | connect(this, SIGNAL(cancelButtonPressed()), this, SLOT(close_event())); 47 | } 48 | 49 | void QtCropEditorDialogue::rebuild_tabs(void) 50 | { 51 | } 52 | void QtCropEditorDialogue::undo_event(void) 53 | { 54 | emit undo_signal(); 55 | } 56 | void QtCropEditorDialogue::close_event(void) 57 | { 58 | reset(); 59 | croptab->exit(); 60 | } 61 | void QtCropEditorDialogue::reload_event(void) 62 | { 63 | emit reload_signal(); 64 | } 65 | void QtCropEditorDialogue::apply_event(void) 66 | { 67 | if(croptab==currentPage()) 68 | { 69 | //emit crop_signal(); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /VolViewer/src/QtCropEditorDialogue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QTCROPEDITOR_H 6 | #define QTCROPEDITOR_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include "QtCropWidget.h" 13 | 14 | class QtCropEditorDialogue: public Q3TabDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | //pointer to our main window 20 | QString appPath; 21 | QtCropWidget* croptab; 22 | 23 | QtCropEditorDialogue(QWidget * parent=0, const char * name=0, bool modal=FALSE, Qt::WFlags f=0, QString app_path=""); 24 | ~QtCropEditorDialogue(); 25 | 26 | void reset(void); 27 | void build_layout(void); 28 | void rebuild_tabs(void); 29 | 30 | private slots: 31 | void undo_event(void); 32 | void close_event(void); 33 | void reload_event(void); 34 | void apply_event(void); 35 | 36 | signals: 37 | void undo_signal(void); 38 | void close_signal(void); 39 | void reload_signal(void); 40 | void filter_signal(void); 41 | }; 42 | 43 | #endif // QTFILTEDITOR_H -------------------------------------------------------------------------------- /VolViewer/src/QtCropWidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QTCROP_H 6 | #define QTCROP_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include "QtGLObjWin.h" 29 | 30 | class QtCropWidget: public QWidget 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | 36 | QtCropWidget(QWidget* parent = 0, const char* name = 0, QString app_path=""); 37 | ~QtCropWidget(); 38 | 39 | QString appPath; 40 | QString currentworkingdir; 41 | 42 | vector channels; 43 | 44 | QPushButton* red; 45 | QPushButton* green; 46 | QPushButton* blue; 47 | 48 | QPushButton* load_pb; 49 | QPushButton* save_pb; 50 | QPushButton* reset_pb; 51 | 52 | QPushButton* lloopmode_button; 53 | 54 | QPushButton* invcrop; 55 | QPushButton* recentre; 56 | 57 | void create(void); 58 | void exit(void); 59 | void reset(void); 60 | void rebuild(void); 61 | 62 | private slots: 63 | 64 | void dragEnterEvent(QDragEnterEvent *event); 65 | void dropEvent(QDropEvent *event); 66 | void reset_button_event(void); 67 | void channel_button_event(int selected); 68 | void load_event(void); 69 | void save_event(void); 70 | 71 | void cropmode_event(void); 72 | void invcrop_button_event(void); 73 | void recentre_button_event(void); 74 | 75 | public slots: 76 | 77 | void dragndrop_slot(QString sFileName); 78 | 79 | signals: 80 | void crop_start_signal(void); 81 | void crop_end_signal(vector channels); 82 | void crop_invsel_signal(int mode); 83 | void crop_recentre_signal(void); 84 | void crop_reset_signal(void); 85 | }; 86 | 87 | #endif // QTCrop_H 88 | -------------------------------------------------------------------------------- /VolViewer/src/QtDatasetViewDialogue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #include 6 | #include 7 | #include 8 | //Added by qt3to4: 9 | #include 10 | //#include //style 11 | 12 | #include 13 | 14 | #include "QtDatasetViewDialogue.h" 15 | 16 | QtDatasetViewDialogue::QtDatasetViewDialogue(QWidget * parent, const char * name, bool modal, Qt::WFlags f) 17 | :Q3TabDialog(parent, name, modal,f) 18 | { 19 | setCaption("Dataset Viewer"); 20 | //setIcon( QPixmap( "Icons/rec.png" )); 21 | build_layout(); 22 | } 23 | 24 | QtDatasetViewDialogue::~QtDatasetViewDialogue(void) 25 | { 26 | } 27 | 28 | void QtDatasetViewDialogue::reset(void) 29 | { 30 | datasetviewtab->reset(); 31 | } 32 | 33 | void QtDatasetViewDialogue::build_layout(void) 34 | { 35 | datasetviewtab = new QtDatasetViewWidget(this, "filttab"); 36 | datasetviewtab->create(); 37 | 38 | //our tab pages 39 | addTab(datasetviewtab, "DatasetView"); 40 | 41 | //some buttons 42 | setCancelButton("Close"); 43 | setOkButton(0); 44 | 45 | connect(this, SIGNAL(cancelButtonPressed()), this, SLOT(close_event())); 46 | 47 | resize(512, 512); 48 | } 49 | 50 | void QtDatasetViewDialogue::rebuild_tabs(void) 51 | { 52 | } 53 | void QtDatasetViewDialogue::undo_event(void) 54 | { 55 | emit undo_signal(); 56 | } 57 | void QtDatasetViewDialogue::close_event(void) 58 | { 59 | reset(); 60 | datasetviewtab->exit(); 61 | } 62 | void QtDatasetViewDialogue::reload_event(void) 63 | { 64 | emit reload_signal(); 65 | } 66 | void QtDatasetViewDialogue::apply_event(void) 67 | { 68 | if(datasetviewtab==currentPage()) 69 | { 70 | //emit crop_signal(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /VolViewer/src/QtDatasetViewDialogue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QTDATASETVIEWEDITOR_H 6 | #define QTDATASETVIEWEDITOR_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include "QtDatasetViewWidget.h" 13 | 14 | class QtDatasetViewDialogue: public Q3TabDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | //pointer to our main window 20 | QtDatasetViewWidget* datasetviewtab; 21 | 22 | QtDatasetViewDialogue(QWidget * parent=0, const char * name=0, bool modal=FALSE, Qt::WFlags f=0); 23 | ~QtDatasetViewDialogue(); 24 | 25 | void reset(void); 26 | void build_layout(void); 27 | void rebuild_tabs(void); 28 | 29 | private slots: 30 | void undo_event(void); 31 | void close_event(void); 32 | void reload_event(void); 33 | void apply_event(void); 34 | 35 | signals: 36 | void undo_signal(void); 37 | void close_signal(void); 38 | void reload_signal(void); 39 | void filter_signal(void); 40 | }; 41 | 42 | #endif // QTDATASETVIEWEDITOR_H -------------------------------------------------------------------------------- /VolViewer/src/QtDatasetViewWidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QTDATASETVIEW_H 6 | #define QTDATASETVIEW_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | #include 32 | using namespace std; 33 | 34 | #include "DatasetView.h" 35 | #include "QtMoviePlayer.h" 36 | 37 | class QtDatasetViewWidget: public QWidget 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | 43 | QtMoviePlayer* movieplayer; 44 | 45 | QString currentworkingdir; 46 | 47 | DatasetView dsview; 48 | QTableWidget* tablewidget; 49 | 50 | QtDatasetViewWidget(QWidget* parent = 0, const char* name = 0); 51 | ~QtDatasetViewWidget(); 52 | 53 | void clear_all(void); 54 | 55 | void create(void); 56 | void exit(void); 57 | void reset(void); 58 | void rebuild(void); 59 | 60 | private slots: 61 | 62 | void saveview_event(void); 63 | 64 | void generatethumbs_event(void); 65 | void openmovieplayer_event(void); 66 | 67 | void align_event(void); 68 | void computestacks_event(void); 69 | 70 | void dragEnterEvent(QDragEnterEvent *event); 71 | void dropEvent(QDropEvent *event); 72 | 73 | void itemDoublClicked_event(QTableWidgetItem* item); 74 | public slots: 75 | 76 | void open(void); 77 | void dragndrop_slot(QString sFileName); 78 | void datasetview_setThumbnail_slot(int i, QPixmap thumbnail); 79 | 80 | signals: 81 | 82 | void datasetview_edit_MSR_signal(QString src_fn, QString dst_fn, int itemindex); 83 | 84 | void datasetview_align_signal(DatasetView dsv); 85 | void datasetview_computestacks_signal(QString dn, DatasetView dsv); 86 | 87 | void datasetview_saveCurrentView_signal(void); 88 | void datasetview_updatethumbnail_signal(int i); 89 | void datasetview_loadFolder_signal(QString dn); 90 | void datasetview_saveSettings_signal(QString dn, QString subdn); 91 | void datasetview_loadSettings_signal(QString dn, QString subdn); 92 | }; 93 | 94 | #endif // QTCrop_H 95 | -------------------------------------------------------------------------------- /VolViewer/src/QtFilterEditorDialogue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #include 6 | #include 7 | #include 8 | //Added by qt3to4: 9 | #include 10 | //#include //style 11 | 12 | #include 13 | 14 | #include "QtFilterEditorDialogue.h" 15 | 16 | QtFilterEditorDialogue::QtFilterEditorDialogue(QWidget * parent, const char * name, bool modal, Qt::WFlags f) 17 | :Q3TabDialog(parent, name, modal,f) 18 | { 19 | setCaption("Filter Editor"); 20 | //setIcon( QPixmap( "Icons/filter.png" )); 21 | build_layout(); 22 | } 23 | 24 | QtFilterEditorDialogue::~QtFilterEditorDialogue(void) 25 | { 26 | } 27 | 28 | void QtFilterEditorDialogue::reset(void) 29 | { 30 | } 31 | 32 | void QtFilterEditorDialogue::build_layout(void) 33 | { 34 | filtertab = new QtFilterWidget(this, "filttab"); 35 | filtertab->create(); 36 | 37 | //our tab pages 38 | addTab(filtertab, "Filters"); 39 | 40 | //some buttons 41 | setCancelButton("Close"); 42 | setOkButton(0); 43 | 44 | connect(this, SIGNAL(cancelButtonPressed()), this, SLOT(close_event())); 45 | } 46 | 47 | void QtFilterEditorDialogue::rebuild_tabs(void) 48 | { 49 | } 50 | void QtFilterEditorDialogue::undo_event(void) 51 | { 52 | emit undo_signal(); 53 | } 54 | void QtFilterEditorDialogue::close_event(void) 55 | { 56 | reset(); 57 | filtertab->exit(); 58 | } 59 | void QtFilterEditorDialogue::reload_event(void) 60 | { 61 | emit reload_signal(); 62 | } 63 | void QtFilterEditorDialogue::apply_event(void) 64 | { 65 | if(filtertab==currentPage()) 66 | { 67 | emit filter_signal(); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /VolViewer/src/QtFilterEditorDialogue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QTFILTEDITOR_H 6 | #define QTFILTEDITOR_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include "QtFilterWidget.h" 13 | 14 | class QtFilterEditorDialogue: public Q3TabDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | //pointer to our main window 20 | QtFilterWidget* filtertab; 21 | 22 | QtFilterEditorDialogue(QWidget * parent=0, const char * name=0, bool modal=FALSE, Qt::WFlags f=0); 23 | ~QtFilterEditorDialogue(); 24 | 25 | void reset(void); 26 | void build_layout(void); 27 | void rebuild_tabs(void); 28 | 29 | private slots: 30 | void undo_event(void); 31 | void close_event(void); 32 | void reload_event(void); 33 | void apply_event(void); 34 | 35 | signals: 36 | void undo_signal(void); 37 | void close_signal(void); 38 | void reload_signal(void); 39 | void filter_signal(void); 40 | }; 41 | 42 | #endif // QTFILTEDITOR_H -------------------------------------------------------------------------------- /VolViewer/src/QtHistoTfuncPixmap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QtHistoTfuncPixmap_H 6 | #define QtHistoTfuncPixmap_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include "FunctionEditor.h" 25 | #include "Tokenizer.h" 26 | #include "Vector.h" 27 | 28 | class QtHistoTfuncPixmap: public QWidget 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | 34 | int mode; 35 | 36 | //current working directory 37 | QString currentworkingdir; 38 | 39 | //display toggles 40 | int hist_enable; 41 | int cumfreq_enable; 42 | int tfunc_enable; 43 | int logscale; 44 | int remaponfly; 45 | 46 | //transfer functions 47 | FunctionEditor funceditor; 48 | 49 | //bright/contrast 50 | int brightness; 51 | int contrast; 52 | 53 | //threshold 54 | int minthr; 55 | int maxthr; 56 | 57 | //Pixmap Graph, we could use QCanvas, TO DO... 58 | float canvas_size; 59 | float graph_size; 60 | float border; 61 | float pensize; 62 | 63 | //pointer to our histogram data 64 | double* data; 65 | double max_histogram; 66 | 67 | QtHistoTfuncPixmap(float size=1); 68 | ~QtHistoTfuncPixmap(); 69 | 70 | void reset(void); 71 | void create(void); 72 | void save(void); 73 | void load(void); 74 | void loadfile(QString); 75 | void sethistogramdata(double* histodata); 76 | 77 | void tfunc_remap16bit(void); 78 | 79 | void draw_functioneditor(QPainter* p); 80 | void draw_functioneditoronpixmap(QPainter* p, FunctionEditor* func, QColor col); 81 | void draw_histogram(QPainter* p); 82 | 83 | protected: 84 | void mouseMoveEvent ( QMouseEvent * e ); 85 | void mousePressEvent ( QMouseEvent * e ); 86 | void mouseReleaseEvent(QMouseEvent * e ); 87 | void paintEvent( QPaintEvent * pe); 88 | void resizeEvent ( QResizeEvent * ); 89 | 90 | public slots: 91 | void tfunc16_setcurrentworkingdir_slot(QString dn); 92 | 93 | signals: 94 | void tfunc_remap16bit_signal(int, int, const vector&); 95 | void tfunc_remapsignal(void); 96 | }; 97 | 98 | #endif // QtHistoTfuncPixmap_H 99 | -------------------------------------------------------------------------------- /VolViewer/src/QtLightEditorDialogue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #include 6 | #include 7 | #include 8 | //Added by qt3to4: 9 | #include 10 | //#include //style 11 | 12 | #include 13 | 14 | #include "QtLightEditorDialogue.h" 15 | 16 | QtLightEditorDialogue::QtLightEditorDialogue(QWidget * parent, const char * name, bool modal, Qt::WFlags f) 17 | :Q3TabDialog(parent, name, modal,f) 18 | { 19 | setCaption("Lighting Editor"); 20 | //setIcon( QPixmap( "Icons/light.png" )); 21 | 22 | build_layout(); 23 | } 24 | 25 | QtLightEditorDialogue::~QtLightEditorDialogue(void) 26 | { 27 | } 28 | 29 | void QtLightEditorDialogue::reset(void) 30 | { 31 | } 32 | 33 | void QtLightEditorDialogue::build_layout(void) 34 | { 35 | //Create the tabs 36 | /* viewsettings_tab = new QtViewSettingsWidget(this, "viewsettings_tab"); 37 | viewsettings_tab->create(); 38 | */ 39 | // rendersettings_tab = new QtRenderSettingsWidget(this, "rendersettings_tab"); 40 | // rendersettings_tab->create(); 41 | 42 | /* 43 | slicessettings_tab = new QtSlicesSettingsWidget(this, "slicessettings_tab"); 44 | slicessettings_tab->create(); 45 | */ 46 | lightettings_tab = new QtLightSettingsWidget(this, "lightettings_tab"); 47 | lightettings_tab->create(); 48 | 49 | /* camerasettings_tab = new QtCameraSettingsWidget(this, "camerasettings_tab"); 50 | camerasettings_tab->create(); 51 | */ 52 | //add them to the widget 53 | // addTab(viewsettings_tab, "Viewing"); 54 | // addTab(slicessettings_tab, "Slices"); 55 | // addTab(camerasettings_tab, "Camera"); 56 | addTab(lightettings_tab, "Lighting"); 57 | // addTab(rendersettings_tab, "Rendering"); 58 | 59 | //only add a close button 60 | setOkButton(NULL); 61 | setCancelButton("Close"); 62 | } 63 | 64 | void QtLightEditorDialogue::rebuild_tabs(void) 65 | { 66 | lightettings_tab->rebuild(); 67 | } 68 | void QtLightEditorDialogue::reset_event(void) 69 | { 70 | } 71 | void QtLightEditorDialogue::apply_event(void) 72 | { 73 | 74 | } 75 | -------------------------------------------------------------------------------- /VolViewer/src/QtLightEditorDialogue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QLIGHTEDITOR_H 6 | #define QLIGHTEDITOR_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include "QtLightSettingsWidget.h" 13 | 14 | class QtLightEditorDialogue: public Q3TabDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | 20 | QtLightEditorDialogue(QWidget * parent=0, const char * name=0, bool modal=FALSE, Qt::WFlags f=0); 21 | ~QtLightEditorDialogue(); 22 | 23 | QtLightSettingsWidget* lightettings_tab; 24 | 25 | void reset(void); 26 | void build_layout(void); 27 | void rebuild_tabs(void); 28 | 29 | private slots: 30 | void reset_event(void); 31 | void apply_event(void); 32 | 33 | signals: 34 | void reset_signal(void); 35 | }; 36 | 37 | #endif // QLIGHTEDITOR_H -------------------------------------------------------------------------------- /VolViewer/src/QtMeasuringEditorDialogue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | #include "QtMeasuringEditorDialogue.h" 13 | 14 | QtMeasuringEditorDialogue::QtMeasuringEditorDialogue(QWidget * parent, const char * name, bool modal, Qt::WFlags f, QString appPath) 15 | :Q3TabDialog(parent, name, modal,f) 16 | { 17 | apppath = appPath; 18 | QSizePolicy sizepolicy; 19 | sizepolicy.setHeightForWidth(TRUE); 20 | setSizePolicy(sizepolicy); 21 | 22 | setCaption("Measuring Editor"); 23 | //setIcon( QPixmap( "Icons/ruler.png" )); 24 | 25 | build_layout(); 26 | } 27 | 28 | QtMeasuringEditorDialogue::~QtMeasuringEditorDialogue(void) 29 | { 30 | } 31 | 32 | void QtMeasuringEditorDialogue::reset(void) 33 | { 34 | measuring_tab->reset(); 35 | } 36 | 37 | void QtMeasuringEditorDialogue::build_layout(void) 38 | { 39 | // printf("creating measuretab\n"); 40 | 41 | //measuring tab 42 | measuring_tab = new QtMeasuringWidget(this, "measuretab", apppath); 43 | measuring_tab->create(); 44 | 45 | //our tab pages 46 | addTab(measuring_tab, "Measuring"); 47 | 48 | setCancelButton("Close"); 49 | setOkButton(0); 50 | } 51 | -------------------------------------------------------------------------------- /VolViewer/src/QtMeasuringEditorDialogue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QTMEASEDITOR_H 6 | #define QTMEASEDITOR_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | //our tab widgets 13 | #include "QtMeasuringWidget.h" 14 | 15 | class QtMeasuringEditorDialogue: public Q3TabDialog 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | 21 | //our tab widgets 22 | QString apppath; 23 | QtMeasuringWidget* measuring_tab; 24 | 25 | QtMeasuringEditorDialogue(QWidget * parent=0, const char * name=0, bool modal=FALSE, Qt::WFlags f=0, QString appPath=""); 26 | ~QtMeasuringEditorDialogue(); 27 | 28 | void reset(void); 29 | void build_layout(void); 30 | void rebuild_tabs(void); 31 | 32 | signals: 33 | void reload_signal(void); 34 | void undo_signal(void); 35 | void close_signal(void); 36 | }; 37 | 38 | #endif // QTMEASEDITOR_H -------------------------------------------------------------------------------- /VolViewer/src/QtMovieEditorDialogue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #include 6 | #include 7 | #include 8 | //Added by qt3to4: 9 | #include 10 | //#include //style 11 | 12 | #include 13 | 14 | #include "QtMovieEditorDialogue.h" 15 | 16 | QtMovieEditorDialogue::QtMovieEditorDialogue(QWidget * parent, const char * name, bool modal, Qt::WFlags f) 17 | :Q3TabDialog(parent, name, modal,f) 18 | { 19 | setCaption("Movie Editor"); 20 | //setIcon( QPixmap( "icons/Simple/movie.png" )); 21 | build_layout(); 22 | } 23 | 24 | QtMovieEditorDialogue::~QtMovieEditorDialogue(void) 25 | { 26 | } 27 | 28 | void QtMovieEditorDialogue::reset(void) 29 | { 30 | } 31 | 32 | void QtMovieEditorDialogue::build_layout(void) 33 | { 34 | //Create the tabs 35 | moviesettings_tab = new QtMovieSettingsWidget(this, "Movieettings_tab"); 36 | moviesettings_tab->create(); 37 | 38 | addTab(moviesettings_tab, "Movies"); 39 | 40 | //only add a close button 41 | setOkButton(NULL); 42 | setCancelButton("Close"); 43 | } 44 | 45 | void QtMovieEditorDialogue::rebuild_tabs(void) 46 | { 47 | moviesettings_tab->rebuild(); 48 | } 49 | void QtMovieEditorDialogue::reset_event(void) 50 | { 51 | } 52 | void QtMovieEditorDialogue::apply_event(void) 53 | { 54 | 55 | } 56 | -------------------------------------------------------------------------------- /VolViewer/src/QtMovieEditorDialogue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QMovieEDITOR_H 6 | #define QMovieEDITOR_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include "QtMovieSettingsWidget.h" 13 | 14 | class QtMovieEditorDialogue: public Q3TabDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | 20 | QtMovieEditorDialogue(QWidget * parent=0, const char * name=0, bool modal=FALSE, Qt::WFlags f=0); 21 | ~QtMovieEditorDialogue(); 22 | 23 | QtMovieSettingsWidget* moviesettings_tab; 24 | 25 | void reset(void); 26 | void build_layout(void); 27 | void rebuild_tabs(void); 28 | 29 | private slots: 30 | void reset_event(void); 31 | void apply_event(void); 32 | 33 | }; 34 | 35 | #endif // QMovieEDITOR_H -------------------------------------------------------------------------------- /VolViewer/src/QtMoviePlayer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QTMOVIEPLAYER_H 6 | #define QTMOVIEPLAYER_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #include 21 | using namespace std; 22 | 23 | class QtMoviePlayer : public QWidget 24 | { 25 | Q_OBJECT 26 | 27 | public: 28 | QtMoviePlayer(QWidget* parent, vector* frames); 29 | int heightForWidth ( int w ); 30 | void resizeEvent ( QResizeEvent * event ); 31 | private slots: 32 | 33 | void goToFrame(int); 34 | void setFrameRate(int); 35 | void updateButtons(); 36 | void saveButton_event(void); 37 | 38 | private: 39 | void createControls(); 40 | void createButtons(); 41 | 42 | int current_index; 43 | vector* movieframes; 44 | QLabel *movieLabel; 45 | 46 | QTimeLine *timeLine; 47 | 48 | QToolButton *playButton; 49 | QToolButton *pauseButton; 50 | QToolButton *stopButton; 51 | QToolButton *saveButton; 52 | 53 | QCheckBox *fitCheckBox; 54 | QSlider *frameSlider; 55 | QSpinBox *speedSpinBox; 56 | QLabel *frameLabel; 57 | QLabel *speedLabel; 58 | 59 | QGridLayout *controlsLayout; 60 | QHBoxLayout *buttonsLayout; 61 | QVBoxLayout *mainLayout; 62 | }; 63 | 64 | #endif -------------------------------------------------------------------------------- /VolViewer/src/QtOMEROLoader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QTOMEROLOADER_H 6 | #define QTOMEROLOADER_H 7 | 8 | #include "MyDefines.h" 9 | 10 | #ifdef OMERO_SUPPORT 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #include "OMEROLoader.h" 22 | 23 | class QtOMEROLoader : public QDialog 24 | { 25 | Q_OBJECT 26 | 27 | public: 28 | 29 | QtOMEROLoader(QWidget *parent = 0, Qt::WFlags flags = 0, OMEROLoader* omerol = NULL, QString appPath = ""); 30 | ~QtOMEROLoader(); 31 | 32 | QPushButton* connect_button; 33 | QLineEdit* imgID_lineedit; 34 | 35 | private: 36 | OMEROLoader* omeroloader; 37 | 38 | QLineEdit* serveraddress_lineedit; 39 | QLineEdit* serverport_lineedit; 40 | QLineEdit* username_lineedit; 41 | QLineEdit* passwd_lineedit; 42 | 43 | QPushButton* cancel_button; 44 | 45 | private slots: 46 | 47 | void serveraddress_event(QString); 48 | void serverport_event(QString); 49 | void username_event(QString); 50 | void passwd_event(QString); 51 | void imgID_event(QString); 52 | void okbutton_event(void); 53 | void cancelbutton_event(void); 54 | 55 | signals: 56 | 57 | }; 58 | 59 | #endif // OMERO_SUPPORT 60 | 61 | #endif // QTNETWORKCLIENTC_H 62 | -------------------------------------------------------------------------------- /VolViewer/src/QtRenderViewDialogue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #include 6 | #include 7 | #include 8 | //Added by qt3to4: 9 | #include 10 | //#include //style 11 | 12 | #include 13 | 14 | #include "QtRenderViewDialogue.h" 15 | 16 | QtRenderViewDialogue::QtRenderViewDialogue(QWidget * parent, const char * name, bool modal, Qt::WFlags f) 17 | :Q3TabDialog(parent, name, modal,f) 18 | { 19 | renviewtab = 0; 20 | 21 | setCaption("Visual Bookmarks"); 22 | //setIcon( QPixmap( "Icons/bookmarks.png" )); 23 | build_layout(); 24 | } 25 | 26 | QtRenderViewDialogue::~QtRenderViewDialogue(void) 27 | { 28 | } 29 | 30 | void QtRenderViewDialogue::reset(void) 31 | { 32 | renviewtab->reset(); 33 | } 34 | 35 | void QtRenderViewDialogue::build_layout(void) 36 | { 37 | renviewtab = new QtRenderViewWidget(this, "renviewtab"); 38 | renviewtab->create(); 39 | 40 | //our tab pages 41 | addTab(renviewtab, "Visual Bookmarks"); 42 | 43 | //some buttons 44 | setCancelButton("Close"); 45 | setOkButton(0); 46 | 47 | connect(this, SIGNAL(cancelButtonPressed()), this, SLOT(close_event())); 48 | 49 | resize(320, 600); 50 | } 51 | 52 | void QtRenderViewDialogue::rebuild_tabs(void) 53 | { 54 | } 55 | void QtRenderViewDialogue::undo_event(void) 56 | { 57 | //emit undo_signal(); 58 | } 59 | void QtRenderViewDialogue::close_event(void) 60 | { 61 | reset(); 62 | renviewtab->exit(); 63 | } 64 | void QtRenderViewDialogue::reload_event(void) 65 | { 66 | //emit reload_signal(); 67 | } 68 | void QtRenderViewDialogue::apply_event(void) 69 | { 70 | if(renviewtab==currentPage()) 71 | { 72 | //emit crop_signal(); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /VolViewer/src/QtRenderViewDialogue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QTRENVIEWEDITOR_H 6 | #define QTRENVIEWEDITOR_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include "QtRenderViewWidget.h" 13 | 14 | class QtRenderViewDialogue: public Q3TabDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | //pointer to our main window 20 | QtRenderViewWidget* renviewtab; 21 | 22 | QtRenderViewDialogue(QWidget * parent=0, const char * name=0, bool modal=FALSE, Qt::WFlags f=0); 23 | ~QtRenderViewDialogue(); 24 | 25 | void reset(void); 26 | void build_layout(void); 27 | void rebuild_tabs(void); 28 | 29 | private slots: 30 | void undo_event(void); 31 | void close_event(void); 32 | void reload_event(void); 33 | void apply_event(void); 34 | 35 | signals: 36 | void undo_signal(void); 37 | void close_signal(void); 38 | void reload_signal(void); 39 | void filter_signal(void); 40 | }; 41 | 42 | #endif // QTFILTEDITOR_H -------------------------------------------------------------------------------- /VolViewer/src/QtRenderViewWidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QTRENVIEW_H 6 | #define QTRENVIEW_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | #include 31 | #include 32 | using namespace std; 33 | 34 | #include "VolumeRenderView.h" 35 | class QtRenderViewWidget: public QWidget 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | 41 | QString currentworkingdir; 42 | 43 | QListWidget* mylistwidget; 44 | vector< VolumeRenderView > volumeviews; 45 | 46 | QtRenderViewWidget(QWidget* parent = 0, const char* name = 0); 47 | ~QtRenderViewWidget(); 48 | 49 | void create(void); 50 | void exit(void); 51 | void reset(void); 52 | void rebuild(void); 53 | void load_file(QString fn); 54 | void save_file(QString fn); 55 | float check_file_version(QString fn); 56 | void load_version0(QString fn); 57 | void load_version1(QString fn); 58 | 59 | private slots: 60 | 61 | void open_event(void); 62 | void save_event(void); 63 | 64 | void saveview_event(void); 65 | void deleteview_event(void); 66 | void updateview_event(void); 67 | 68 | void interpolate_event(void); 69 | 70 | void dragEnterEvent(QDragEnterEvent *event); 71 | void dropEvent(QDropEvent *event); 72 | 73 | void itemDoublClicked_event(QListWidgetItem* item); 74 | 75 | public slots: 76 | 77 | void renderview_selectItem(int index); 78 | void renderview_setcurrentworkingdir_slot(QString dn); 79 | 80 | void renderview_addsavedview_slot(QPixmap* pixmap); 81 | void renderview_addview_slot(QPixmap* pixmap, VolumeRenderView view); 82 | void renderview_updateview_slot(int, QPixmap*, VolumeRenderView); 83 | 84 | void renderview_getallviews_slot(void); 85 | 86 | void dragndrop_slot(QString sFileName); 87 | 88 | signals: 89 | void renderview_saveview_signal(void); 90 | void renderview_updateview_signal(int); 91 | 92 | void renderview_renderview_signal(VolumeRenderView view); 93 | void renderview_setview_signal(VolumeRenderView view); 94 | void renderview_interpolate_signal(vector< VolumeRenderView > volumeviews); 95 | }; 96 | 97 | #endif // QTCrop_H 98 | -------------------------------------------------------------------------------- /VolViewer/src/QtSplashScreen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QTSPLASHSCREEN_H 6 | #define QTSPLASHSCREEN_H 7 | 8 | #include 9 | #include 10 | //Added by qt3to4: 11 | #include 12 | #include 13 | 14 | #include "MyDefines.h" 15 | #include "SVNObject.h" 16 | 17 | class QtSplashScreen : public QWidget 18 | { 19 | Q_OBJECT 20 | public: 21 | SVNObject svn; 22 | QtSplashScreen( const QPixmap &pixmap, int window_main_screen); 23 | 24 | void setWinPosition(int window_main_screen); 25 | void setStatus( const QString &message, int alignment = Qt::AlignLeft, const QColor &color = Qt::black ); 26 | void repaint(); 27 | public slots: 28 | void finish(void); 29 | protected: 30 | void mousePressEvent( QMouseEvent * ); 31 | 32 | private: 33 | QPixmap pix; 34 | }; 35 | 36 | #endif //QTSPLASHSCREEN_H 37 | -------------------------------------------------------------------------------- /VolViewer/src/QtStereoEditorDialogue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #include 6 | #include 7 | #include 8 | //Added by qt3to4: 9 | #include 10 | //#include //style 11 | 12 | #include 13 | 14 | #include "QtStereoEditorDialogue.h" 15 | 16 | QtStereoEditorDialogue::QtStereoEditorDialogue(QWidget * parent, const char * name, bool modal, Qt::WFlags f) 17 | :Q3TabDialog(parent, name, modal,f) 18 | { 19 | setCaption("Stereo Editor"); 20 | //setIcon( QPixmap( "icons/config.png" )); 21 | 22 | build_layout(); 23 | } 24 | 25 | QtStereoEditorDialogue::~QtStereoEditorDialogue(void) 26 | { 27 | } 28 | 29 | void QtStereoEditorDialogue::reset(void) 30 | { 31 | } 32 | 33 | void QtStereoEditorDialogue::build_layout(void) 34 | { 35 | //Create the tabs 36 | 37 | stereosettings_tab = new QtStereoSettingsWidget(this, "stereosettings_tab"); 38 | stereosettings_tab->create(); 39 | 40 | addTab(stereosettings_tab, "Stereo Rendering"); 41 | 42 | //only add a close button 43 | setOkButton(NULL); 44 | setCancelButton("Close"); 45 | } 46 | 47 | void QtStereoEditorDialogue::rebuild_tabs(void) 48 | { 49 | // rendersettings_tab->rebuild(); 50 | } 51 | void QtStereoEditorDialogue::reset_event(void) 52 | { 53 | } 54 | void QtStereoEditorDialogue::apply_event(void) 55 | { 56 | 57 | } 58 | -------------------------------------------------------------------------------- /VolViewer/src/QtStereoEditorDialogue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QSTEREOEDITOR_H 6 | #define QSTEREOEDITOR_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include "QtStereoSettingsWidget.h" 13 | 14 | class QtStereoEditorDialogue: public Q3TabDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | 20 | QtStereoSettingsWidget* stereosettings_tab; 21 | 22 | QtStereoEditorDialogue(QWidget * parent=0, const char * name=0, bool modal=FALSE, Qt::WFlags f=0); 23 | ~QtStereoEditorDialogue(); 24 | 25 | void reset(void); 26 | void build_layout(void); 27 | void rebuild_tabs(void); 28 | 29 | private slots: 30 | void reset_event(void); 31 | void apply_event(void); 32 | 33 | signals: 34 | void reset_signal(void); 35 | }; 36 | 37 | #endif // QMEASUREEDITOR_H -------------------------------------------------------------------------------- /VolViewer/src/QtStereoSettingsWidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QtStereoSettingsWidget_H 6 | #define QtStereoSettingsWidget_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include "Vector.h" 29 | #include "ColourFun.h" 30 | 31 | class QtStereoSettingsWidget: public QWidget 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | 37 | QtStereoSettingsWidget(QWidget* parent, const char* name); 38 | ~QtStereoSettingsWidget(); 39 | 40 | QPushButton* load; 41 | QPushButton* save; 42 | 43 | //inter ocular distance 44 | Q3ButtonGroup* stereo_seperation_grp; 45 | QLabel* stereo_seperation_lb; 46 | QSlider* stereo_seperation_slider; 47 | int stereo_seperation; 48 | 49 | //z-screen position 50 | Q3ButtonGroup* zscreen_grp; 51 | QLabel* zscreen_lb; 52 | QSlider* zscreen_slider; 53 | int zscreen; 54 | 55 | //renderquality_lod 56 | QPushButton* stereo_onoff_pb; 57 | 58 | Q3ButtonGroup* stereo_rendermodegrp; 59 | QPushButton* stereo_RBanaglyth_pb; 60 | QPushButton* stereo_RGanaglyth_pb; 61 | QPushButton* stereo_RCanaglyth_pb; 62 | QPushButton* stereo_quadbuffer_pb; 63 | 64 | void create(void); 65 | void reset(void); 66 | void rebuild(void); 67 | void apply(void); 68 | void reload(void); 69 | 70 | void set_fromini(int toggle, int mode, float value); 71 | 72 | private slots: 73 | 74 | void load_event(void); 75 | void save_event(void); 76 | 77 | void stereo_onoff_event(void); 78 | void stereo_rendermode_event(int); 79 | void stereo_seperation_event(int); 80 | void zscreen_event(int); 81 | 82 | signals: 83 | 84 | void stereo_onoff_signal(int); 85 | void stereo_rendermode_signal(int); 86 | void stereo_seperation_signal(float); 87 | void stereo_zscreen_signal(float); 88 | }; 89 | 90 | #endif // QtStereoSettingsWidget_H 91 | -------------------------------------------------------------------------------- /VolViewer/src/QtThreadedBrickLoader.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #include "QtThreadedBrickLoader.h" 6 | 7 | QtThreadedBrickLoader::QtThreadedBrickLoader(int ind, VolIO* vio, QStringList sList, int xs, int ys, int zs, int bX, int bY, int bZ, vector* d, vector* eb) 8 | { 9 | index = ind; 10 | volio = vio; 11 | data = d; 12 | 13 | xstart = xs; 14 | ystart = ys; 15 | zstart = zs; 16 | brickresX = bX; 17 | brickresY = bY; 18 | brickresZ = bZ; 19 | 20 | strList = sList; 21 | empty_brick = eb; 22 | } 23 | QtThreadedBrickLoader::~QtThreadedBrickLoader() 24 | { 25 | //printf("Thread Finished: %d\n", index); 26 | //printf("isnonempty: %d\n", (int)empty_brick[index]); 27 | 28 | //emit isfinished_signal(index, isnonempty); 29 | } 30 | 31 | void QtThreadedBrickLoader::run() 32 | { 33 | //bool* myarray = &(empty_brick->front()); 34 | //myarray[index] = false; 35 | bool empty = volio->load_subimage(strList, xstart, ystart, zstart, brickresX, brickresY, brickresZ, &(data->front())); 36 | //if(empty==true) data->clear(); 37 | //printf("empty: %d\n", (int)empty); 38 | //if(empty_brick[index]==true) data->clear(); 39 | } -------------------------------------------------------------------------------- /VolViewer/src/QtThreadedBrickLoader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QTTHREADEDBRICKLOADER_H 6 | #define QTTHREADEDBRICKLOADER_H 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | #include "VolIO.h" 14 | 15 | using namespace std; 16 | 17 | class QtThreadedBrickLoader : public QRunnable 18 | { 19 | private: 20 | int index; 21 | VolIO* volio; 22 | vector* empty_brick; 23 | vector* data; 24 | QStringList strList; 25 | int xstart; 26 | int ystart; 27 | int zstart; 28 | int brickresX; 29 | int brickresY; 30 | int brickresZ; 31 | public: 32 | QtThreadedBrickLoader(int ind, VolIO* vio, QStringList sList, int xs, int ys, int zs, int bX, int bY, int bZ, vector* d, vector* eb); 33 | ~QtThreadedBrickLoader(); 34 | void run(); 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /VolViewer/src/QtThreadedSliceLoader.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #include "QtThreadedSliceLoader.h" 6 | 7 | QtThreadedSliceLoader::QtThreadedSliceLoader(VolumeObject* vo, QString filename, QString e, int x, int y, int z, int m) 8 | { 9 | volobj = vo; 10 | 11 | fn = filename; 12 | ext = e; 13 | x2=x; 14 | y2=y; 15 | z2=z; 16 | mode=m; 17 | } 18 | 19 | QtThreadedSliceLoader::~QtThreadedSliceLoader() 20 | { 21 | 22 | } 23 | void QtThreadedSliceLoader::run() 24 | { 25 | /*printf("fn: %s\n",fn.latin1()); 26 | printf("ext: %s\n",ext.latin1()); 27 | printf("x2: %d\n",x2); 28 | printf("y2: %d\n",y2); 29 | printf("z2: %d\n",z2); 30 | printf("mode: %d\n",mode);*/ 31 | 32 | QImage img; 33 | img.load(fn, ext); 34 | int index_small; 35 | int r,g,b; 36 | 37 | for(float x=0 ; xwidth-1; x+=volobj->x_resize) 38 | { 39 | for(float y=0; yheight-1; y+=volobj->y_resize) 40 | { 41 | //make sure we round up to nearest int for x,y 42 | QRgb pixel = img.pixel(int(x+0.5),int(y+0.5)); 43 | 44 | if(x2>=volobj->resized_texwidth) x2=volobj->resized_texwidth-1; 45 | if(y2>=volobj->resized_texheight) y2=volobj->resized_texheight-1; 46 | if(z2>=volobj->resized_texdepth) z2=volobj->resized_texdepth-1; 47 | 48 | index_small = (((((z2)*volobj->resized_texheight)+(y2))*volobj->resized_texwidth)+(x2)); 49 | 50 | r = qRed(pixel); 51 | g = qGreen(pixel); 52 | b = qBlue(pixel); 53 | 54 | if(r!=0 || g!=0 || b!=0) 55 | { 56 | if(mode==4) 57 | { 58 | volobj->texture3d[3*index_small+0] = int(r); 59 | volobj->texture3d[3*index_small+1] = int(g); 60 | volobj->texture3d[3*index_small+2] = int(b); 61 | volobj->histogram[(3*int(r))+0]++; 62 | volobj->histogram[(3*int(g))+1]++; 63 | volobj->histogram[(3*int(b))+2]++; 64 | } 65 | else if(mode==1) 66 | { 67 | volobj->texture3d[3*index_small+0] = int(r); 68 | volobj->histogram[(3*int(r))+0]++; 69 | } 70 | else if(mode==2) 71 | { 72 | volobj->texture3d[3*index_small+1] = int(g); 73 | volobj->histogram[(3*int(g))+1]++; 74 | } 75 | else if(mode==3) 76 | { 77 | volobj->texture3d[3*index_small+2] = int(b); 78 | volobj->histogram[(3*int(b))+2]++; 79 | } 80 | } 81 | y2++; 82 | } 83 | x2++; 84 | y2=0; 85 | } 86 | } -------------------------------------------------------------------------------- /VolViewer/src/QtThreadedSliceLoader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QTTHREADEDSLICELOADER_H 6 | #define QTTHREADEDSLICELOADER_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | #include "VolumeObject.h" 15 | 16 | using namespace std; 17 | 18 | class QtThreadedSliceLoader //: public QRunnable 19 | 20 | { 21 | public: 22 | 23 | VolumeObject* volobj; 24 | 25 | QString fn; 26 | QString ext; 27 | int x2; 28 | int y2; 29 | int z2; 30 | int mode; 31 | 32 | QtThreadedSliceLoader(VolumeObject* vo, QString fn, QString e, int x2, int y2, int z2, int mode); 33 | ~QtThreadedSliceLoader(); 34 | void run(); 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /VolViewer/src/QtTransferFuncDialogue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #include 6 | #include 7 | #include 8 | //Added by qt3to4: 9 | #include 10 | //#include //style 11 | 12 | #include 13 | 14 | #include "QtTransferFuncDialogue.h" 15 | 16 | QtTransferFuncDialogue::QtTransferFuncDialogue(QWidget * parent, const char * name, bool modal, Qt::WFlags f) 17 | :Q3TabDialog(parent, name, modal,f) 18 | { 19 | /*QSizePolicy sizepolicy; 20 | sizepolicy.setHeightForWidth(TRUE); 21 | setSizePolicy(sizepolicy);*/ 22 | 23 | setCaption("Transfer Function Editor"); 24 | setIcon( QPixmap( "icons/Simple/function.png" )); 25 | 26 | build_layout(); 27 | resize(780,700); 28 | } 29 | 30 | QtTransferFuncDialogue::~QtTransferFuncDialogue(void) 31 | { 32 | } 33 | void QtTransferFuncDialogue::resizeEvent ( QResizeEvent *e ) 34 | { 35 | // printf("width: %d\n", width()); 36 | // printf("height: %d\n", height()); 37 | } 38 | void QtTransferFuncDialogue::reset(void) 39 | { 40 | tranfer_func_tab->reset(); 41 | } 42 | 43 | void QtTransferFuncDialogue::build_layout(void) 44 | { 45 | //transfer function tab, needs a pointer to our histogram data 46 | tranfer_func_tab = new QtTransferFuncWidget(this, "transfertab"); 47 | tranfer_func_tab->create(); 48 | 49 | addTab(tranfer_func_tab, "Transfer Function"); 50 | 51 | setCancelButton("Close"); 52 | setOkButton(0); 53 | } 54 | 55 | void QtTransferFuncDialogue::rebuild_tabs(void) 56 | { 57 | tranfer_func_tab->rebuild(); 58 | } 59 | -------------------------------------------------------------------------------- /VolViewer/src/QtTransferFuncDialogue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QtTransferFuncDialogue_H 6 | #define QtTransferFuncDialogue_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include "QtHistoTfuncPixmap.h" 13 | #include "QtTransferFuncWidget.h" 14 | 15 | class QtTransferFuncDialogue: public Q3TabDialog 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | //our tab widgets 21 | QtTransferFuncWidget* tranfer_func_tab; 22 | 23 | QtTransferFuncDialogue(QWidget * parent=0, const char * name=0, bool modal=FALSE, Qt::WFlags f=0); 24 | ~QtTransferFuncDialogue(); 25 | 26 | void reset(void); 27 | void build_layout(void); 28 | void rebuild_tabs(void); 29 | void resizeEvent ( QResizeEvent *e ); 30 | 31 | }; 32 | 33 | #endif // QtTransferFuncDialogue_H 34 | -------------------------------------------------------------------------------- /VolViewer/src/QtTransferFunctionEditorDialogue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QTTRANSFEREDITOR_H 6 | #define QTTRANSFEREDITOR_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include "QtHistogram.h" 13 | 14 | //our tab widgets 15 | #include "QtTransferFunctionWidget.h" 16 | //#include "QtHSVRemapWidget.h" 17 | //#include "QtRGBRemapWidget.h" 18 | //#include "QtThresholdWidget.h" 19 | //#include "QtBrightContWidget.h" 20 | //#include "QtMiscWidget.h" 21 | 22 | 23 | class QtTransferFunctionEditorDialogue: public Q3TabDialog 24 | { 25 | Q_OBJECT 26 | 27 | public: 28 | //our tab widgets 29 | QtTransferFunctionWidget* tranfer_function_tab; 30 | /* QtHSVRemapWidget* hsv_remap_tab; 31 | QtRGBRemapWidget* rgb_remap_tab; 32 | QtBrightContWidget* bricon_tab; 33 | QtThresholdWidget* threshold_tab; 34 | QtMiscWidget* misc_tab;*/ 35 | 36 | //our histogram data 37 | double max_histogram; 38 | double histogram[256]; 39 | 40 | QtTransferFunctionEditorDialogue(QWidget * parent=0, const char * name=0, bool modal=FALSE, Qt::WFlags f=0); 41 | ~QtTransferFunctionEditorDialogue(); 42 | 43 | void reset(void); 44 | void build_layout(void); 45 | void rebuild_tabs(void); 46 | void histogram_clear(void); 47 | 48 | private slots: 49 | void reload_event(void); 50 | void undo_event(void); 51 | void close_event(void); 52 | void apply_event(void); 53 | void resizeEvent ( QResizeEvent *e ); 54 | 55 | signals: 56 | void undo_signal(void); 57 | void reload_signal(void); 58 | void close_signal(void); 59 | }; 60 | 61 | #endif // QTTRANSFEREDITOR_H -------------------------------------------------------------------------------- /VolViewer/src/QtTransformEditorDialogue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #include 6 | #include 7 | #include 8 | //Added by qt3to4: 9 | #include 10 | //#include //style 11 | 12 | #include 13 | 14 | #include "QtTransformEditorDialogue.h" 15 | 16 | QtTransformEditorDialogue::QtTransformEditorDialogue(QWidget * parent, const char * name, bool modal, Qt::WFlags f) 17 | :Q3TabDialog(parent, name, modal,f) 18 | { 19 | setCaption("Clipping Editor"); 20 | setIcon( QPixmap( "icons/Simple/cut.png" )); 21 | build_layout(); 22 | } 23 | 24 | QtTransformEditorDialogue::~QtTransformEditorDialogue(void) 25 | { 26 | } 27 | 28 | void QtTransformEditorDialogue::reset(void) 29 | { 30 | } 31 | 32 | void QtTransformEditorDialogue::build_layout(void) 33 | { 34 | cliptab = new QtCLippingWidget(this, "cliptab"); 35 | cliptab->create(); 36 | 37 | //our tab pages 38 | addTab(cliptab, "Clipping"); 39 | 40 | //some buttons 41 | // setApplyButton ("Apply"); 42 | // setDefaultButton("Undo"); 43 | // setHelpButton("Reload"); 44 | setCancelButton("Close"); 45 | setOkButton(0); 46 | 47 | // connect(this, SIGNAL(applyButtonPressed()), this, SLOT(apply_event())); 48 | // connect(this, SIGNAL(defaultButtonPressed()), this, SLOT(undo_event())); 49 | // connect(this, SIGNAL(helpButtonPressed()), this, SLOT(reload_event())); 50 | connect(this, SIGNAL(cancelButtonPressed()), this, SLOT(close_event())); 51 | } 52 | 53 | void QtTransformEditorDialogue::rebuild_tabs(void) 54 | { 55 | } 56 | void QtTransformEditorDialogue::undo_event(void) 57 | { 58 | emit undo_signal(); 59 | } 60 | void QtTransformEditorDialogue::close_event(void) 61 | { 62 | reset(); 63 | cliptab->exit(); 64 | 65 | //emit close_signal(); 66 | } 67 | void QtTransformEditorDialogue::reload_event(void) 68 | { 69 | emit reload_signal(); 70 | } 71 | void QtTransformEditorDialogue::apply_event(void) 72 | { 73 | if(cliptab==currentPage()) 74 | { 75 | emit clip_signal(); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /VolViewer/src/QtTransformEditorDialogue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QTRANSEDITOR_H 6 | #define QTRANSEDITOR_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include "QtCLippingWidget.h" 13 | 14 | class QtTransformEditorDialogue: public Q3TabDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | //pointer to our main window 20 | QtCLippingWidget* cliptab; 21 | 22 | QtTransformEditorDialogue(QWidget * parent=0, const char * name=0, bool modal=FALSE, Qt::WFlags f=0); 23 | ~QtTransformEditorDialogue(); 24 | 25 | void reset(void); 26 | void build_layout(void); 27 | void rebuild_tabs(void); 28 | 29 | private slots: 30 | void undo_event(void); 31 | void close_event(void); 32 | void reload_event(void); 33 | void apply_event(void); 34 | 35 | signals: 36 | void undo_signal(void); 37 | void close_signal(void); 38 | void reload_signal(void); 39 | void clip_signal(void); 40 | }; 41 | 42 | #endif // QTRANSEDITOR_H -------------------------------------------------------------------------------- /VolViewer/src/QtTransformWidget.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #include "QtTransformWidget.h" 6 | 7 | 8 | QtTransformWidget::QtTransformWidget(QWidget* parent, const char* name) 9 | : QWidget( parent, name ) 10 | { 11 | 12 | } 13 | QtTransformWidget::~QtTransformWidget() 14 | { 15 | 16 | } 17 | 18 | void QtTransformWidget::rebuild(void) 19 | { 20 | } 21 | void QtTransformWidget::reset(void) 22 | { 23 | } 24 | void QtTransformWidget::create(void) 25 | { 26 | } 27 | -------------------------------------------------------------------------------- /VolViewer/src/QtTransformWidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QTTRANSFORM_H 6 | #define QTTRANSFORM_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | //#include //style 13 | 14 | class QtTransformWidget: public QWidget 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | QtTransformWidget(QWidget* parent = 0, const char* name = 0); 20 | ~QtTransformWidget(); 21 | 22 | void create(void); 23 | void reset(void); 24 | void rebuild(void); 25 | 26 | private slots: 27 | 28 | }; 29 | 30 | #endif // QTTRANSFORM_H -------------------------------------------------------------------------------- /VolViewer/src/QtViewEditorDialogue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #include 6 | #include 7 | #include 8 | //Added by qt3to4: 9 | #include 10 | //#include //style 11 | 12 | #include 13 | 14 | #include "QtViewEditorDialogue.h" 15 | 16 | QtViewEditorDialogue::QtViewEditorDialogue(QWidget * parent, const char * name, bool modal, Qt::WFlags f) 17 | :Q3TabDialog(parent, name, modal,f) 18 | { 19 | setCaption("Settings Editor"); 20 | //setIcon( QPixmap( "icons/Simple/spanner.png" )); 21 | 22 | build_layout(); 23 | } 24 | 25 | QtViewEditorDialogue::~QtViewEditorDialogue(void) 26 | { 27 | } 28 | 29 | void QtViewEditorDialogue::reset(void) 30 | { 31 | } 32 | 33 | void QtViewEditorDialogue::build_layout(void) 34 | { 35 | //Create the tabs 36 | /* viewsettings_tab = new QtViewSettingsWidget(this, "viewsettings_tab"); 37 | viewsettings_tab->create(); 38 | */ 39 | rendersettings_tab = new QtRenderSettingsWidget(this, "rendersettings_tab"); 40 | rendersettings_tab->create(); 41 | 42 | /* 43 | slicessettings_tab = new QtSlicesSettingsWidget(this, "slicessettings_tab"); 44 | slicessettings_tab->create(); 45 | */ 46 | // lightettings_tab = new QtLightSettingsWidget(this, "lightettings_tab"); 47 | // lightettings_tab->create(); 48 | 49 | /* camerasettings_tab = new QtCameraSettingsWidget(this, "camerasettings_tab"); 50 | camerasettings_tab->create(); 51 | */ 52 | //add them to the widget 53 | // addTab(viewsettings_tab, "Viewing"); 54 | // addTab(slicessettings_tab, "Slices"); 55 | // addTab(camerasettings_tab, "Camera"); 56 | // addTab(lightettings_tab, "Lighting"); 57 | addTab(rendersettings_tab, "Settings"); 58 | 59 | //only add a close button 60 | setOkButton(NULL); 61 | setCancelButton("Close"); 62 | } 63 | 64 | void QtViewEditorDialogue::rebuild_tabs(void) 65 | { 66 | // printf("BOH\n"); 67 | rendersettings_tab->rebuild(); 68 | } 69 | void QtViewEditorDialogue::reset_event(void) 70 | { 71 | } 72 | void QtViewEditorDialogue::apply_event(void) 73 | { 74 | 75 | } 76 | -------------------------------------------------------------------------------- /VolViewer/src/QtViewEditorDialogue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QVIEWEDITOR_H 6 | #define QVIEWEDITOR_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | //#include "QtViewSettingsWidget.h" 13 | #include "QtRenderSettingsWidget.h" 14 | //#include "QtSlicesSettingsWidget.h" 15 | //#include "QtCameraSettingsWidget.h" 16 | 17 | class QtViewEditorDialogue: public Q3TabDialog 18 | { 19 | Q_OBJECT 20 | 21 | public: 22 | 23 | QtViewEditorDialogue(QWidget * parent=0, const char * name=0, bool modal=FALSE, Qt::WFlags f=0); 24 | ~QtViewEditorDialogue(); 25 | 26 | /*QtViewSettingsWidget* viewsettings_tab;*/ 27 | QtRenderSettingsWidget* rendersettings_tab; 28 | /*QtSlicesSettingsWidget* slicessettings_tab; 29 | QtCameraSettingsWidget* camerasettings_tab;*/ 30 | 31 | void reset(void); 32 | void build_layout(void); 33 | void rebuild_tabs(void); 34 | 35 | private slots: 36 | void reset_event(void); 37 | void apply_event(void); 38 | 39 | signals: 40 | void reset_signal(void); 41 | }; 42 | 43 | #endif // QMEASUREEDITOR_H -------------------------------------------------------------------------------- /VolViewer/src/QtViewSettingsWidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QTVIEWSETTINGSWIDGET_H 6 | #define QTVIEWSETTINGSWIDGET_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #include "Vector.h" 24 | #include "ColourFun.h" 25 | 26 | class QtViewSettingsWidget: public QWidget 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | 32 | QtViewSettingsWidget(QWidget* parent, const char* name); 33 | ~QtViewSettingsWidget(); 34 | 35 | //bounding box label & colour 36 | QLabel* bbcol_lb; 37 | QColor bbcolour; 38 | 39 | //background label & colour 40 | QLabel* bgcol_lb; 41 | QColor bgcolour; 42 | 43 | void create(void); 44 | void reset(void); 45 | void rebuild(void); 46 | void apply(void); 47 | 48 | private slots: 49 | 50 | void bb_colourdlg_event(void); 51 | void bg_colourdlg_event(void); 52 | 53 | signals: 54 | 55 | }; 56 | 57 | #endif // QTVIEWSETTINGSWIDGET_H 58 | -------------------------------------------------------------------------------- /VolViewer/src/QtVolumeEditorDialogue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #include 6 | #include 7 | #include 8 | //Added by qt3to4: 9 | #include 10 | //#include //style 11 | 12 | #include 13 | 14 | #include "QtVolumeEditorDialogue.h" 15 | 16 | QtVolumeEditorDialogue::QtVolumeEditorDialogue(QWidget * parent, const char * name, bool modal, Qt::WFlags f) 17 | :Q3TabDialog(parent, name, modal,f) 18 | { 19 | QSizePolicy sizepolicy; 20 | sizepolicy.setHeightForWidth(TRUE); 21 | setSizePolicy(sizepolicy); 22 | 23 | setCaption("Iso-Surface Editor"); 24 | //setIcon( QPixmap( "icons/Simple/surface.png" )); 25 | 26 | build_layout(); 27 | } 28 | 29 | QtVolumeEditorDialogue::~QtVolumeEditorDialogue(void) 30 | { 31 | } 32 | 33 | void QtVolumeEditorDialogue::reset(void) 34 | { 35 | isosurface_tab->reset(); 36 | // filter_tab->reset(); 37 | } 38 | 39 | void QtVolumeEditorDialogue::build_layout(void) 40 | { 41 | //iso value tab, needs a pointer to our histogram data 42 | isosurface_tab = new QtIsoSurfaceWidget(this, "isovaluetab"); 43 | isosurface_tab->create(); 44 | 45 | // filter_tab = new QtFilterWidget(this, "filter_tab"); 46 | // filter_tab->create(); 47 | 48 | //our tab pages 49 | addTab(isosurface_tab, "IsoSurface"); 50 | // addTab(filter_tab, "3D Volume Filters"); 51 | 52 | //some buttons 53 | // setApplyButton ("Apply"); 54 | // setDefaultButton("Undo"); 55 | // setHelpButton("Reload"); 56 | setCancelButton("Close"); 57 | setOkButton(0); 58 | 59 | connect(this, SIGNAL(applyButtonPressed()), this, SLOT(apply_event())); 60 | connect(this, SIGNAL(defaultButtonPressed()), this, SLOT(undo_event())); 61 | connect(this, SIGNAL(helpButtonPressed()), this, SLOT(reload_event())); 62 | connect(this, SIGNAL(cancelButtonPressed()), this, SLOT(close_event())); 63 | 64 | resize(400, 400); 65 | } 66 | 67 | void QtVolumeEditorDialogue::rebuild_tabs(void) 68 | { 69 | // isosurface_tab->rebuild(); 70 | // threshold_tab->rebuild(); 71 | // floodfill_tab->rebuild(); 72 | // filter_tab->rebuild(); 73 | } 74 | void QtVolumeEditorDialogue::reload_event(void) 75 | { 76 | emit reload_signal(); 77 | } 78 | void QtVolumeEditorDialogue::undo_event(void) 79 | { 80 | emit undo_signal(); 81 | } 82 | void QtVolumeEditorDialogue::close_event(void) 83 | { 84 | reset(); 85 | // emit close_signal(); 86 | 87 | } 88 | void QtVolumeEditorDialogue::apply_event(void) 89 | { 90 | /*if(isosurface_tab==currentPage()) 91 | { 92 | isosurface_tab->emit_isofurface(); 93 | }*/ 94 | /* else if(filter_tab==currentPage()) 95 | { 96 | filter_tab->emit_filter(); 97 | }*/ 98 | } 99 | -------------------------------------------------------------------------------- /VolViewer/src/QtVolumeEditorDialogue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QTVOLEDITOR_H 6 | #define QTVOLEDITOR_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | //our tab widgets 13 | #include "QtIsoSurfaceWidget.h" 14 | //#include "QtFilterWidget.h" 15 | class QtVolumeEditorDialogue: public Q3TabDialog 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | 21 | //our tab widgets 22 | QtIsoSurfaceWidget* isosurface_tab; 23 | //QtFilterWidget* filter_tab; 24 | 25 | QtVolumeEditorDialogue(QWidget * parent=0, const char * name=0, bool modal=FALSE, Qt::WFlags f=0); 26 | ~QtVolumeEditorDialogue(); 27 | 28 | void reset(void); 29 | void build_layout(void); 30 | void rebuild_tabs(void); 31 | 32 | private slots: 33 | void apply_event(void); 34 | void reload_event(void); 35 | void undo_event(void); 36 | void close_event(void); 37 | 38 | signals: 39 | void reload_signal(void); 40 | void undo_signal(void); 41 | void close_signal(void); 42 | }; 43 | 44 | #endif // QTVOLEDITOR_H -------------------------------------------------------------------------------- /VolViewer/src/Quaternion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef QUATERNION_H 6 | #define QUATERNION_H 7 | 8 | #include 9 | 10 | #include "Vector.h" 11 | #include "Matrix.h" 12 | 13 | class Quaternion 14 | { 15 | public: 16 | 17 | Vector quat; 18 | 19 | Quaternion(); 20 | Quaternion(Vector v, double rho); 21 | ~Quaternion(); 22 | 23 | void from_matrix(Matrix3f_t *src); 24 | void from_angle(Vector pos, float degrees); 25 | 26 | void to_matrix(Matrix3f_t *dst); 27 | void to_euler(Vector* v); 28 | 29 | Vector apply(const Vector& v) const; 30 | Quaternion operator *(Quaternion q); 31 | }; 32 | 33 | void slerp(Quaternion* from, Quaternion * to, float t, Quaternion* res); 34 | 35 | #endif //QUATERNION_H -------------------------------------------------------------------------------- /VolViewer/src/RAW.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef RAW_H 6 | #define RAW_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | using namespace std; 15 | 16 | #include "Vector.h" 17 | #include "ColourFun.h" 18 | 19 | class RAW_volume 20 | { 21 | 22 | public: 23 | 24 | int loadmode; 25 | int res_x, res_y, res_z; 26 | int channels; 27 | float WLZ_scale; 28 | 29 | RAW_volume(); 30 | ~RAW_volume(); 31 | 32 | void load_DAT(const std::string &filename); 33 | void load_RAW(int z, FILE *f, unsigned char* tex_buffer, int mode, int texy, int texx, double* hist, bool* red, bool* green, bool* blue, bool* greyscale); 34 | 35 | void save_DAT(const std::string &filename, int x, int y, int z, float scale); 36 | void save_RAW(FILE *f, unsigned char* vol_buffer, int resx, int resy, int z); 37 | 38 | }; 39 | 40 | #endif //RAW_H 41 | 42 | -------------------------------------------------------------------------------- /VolViewer/src/SVNObject.cpp: -------------------------------------------------------------------------------- 1 | #include "SVNObject.h" 2 | 3 | SVNObject::SVNObject() 4 | { 5 | revision = "246"; 6 | modified = "Modified"; 7 | date = "2013/08/01 15:33:19"; 8 | range = "224:246"; 9 | uRL = "https://cmpdartsvr1.cmp.uea.ac.uk/banghamlabSVN/VolViewer/VolViewer"; 10 | } -------------------------------------------------------------------------------- /VolViewer/src/SVNObject.h: -------------------------------------------------------------------------------- 1 | #ifndef SVNOBJECT_H 2 | #define SVNOBJECT_H 3 | 4 | #include 5 | 6 | class SVNObject 7 | { 8 | 9 | public: 10 | QString revision; 11 | QString modified; 12 | QString date; 13 | QString range; 14 | QString uRL; 15 | 16 | SVNObject(); 17 | }; 18 | 19 | #endif //SVNOBJECT_H -------------------------------------------------------------------------------- /VolViewer/src/ShaderDefinitions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef SHADERDEFINITIONS_H 6 | #define SHADERDEFINITIONS_H 7 | 8 | #define SHADER_NONE -1 //0 9 | #define SHADER_NOLIGHT 1 //2 10 | #define SHADER_PHOTOREAL 2 //4 11 | #define SHADER_NONPHOTOREAL 3 //6 12 | #define SHADER_SEM 4 //7 13 | #define SHADER_LAMBERT 5 //3 14 | #define SHADER_TOON 6 //8 15 | #define SHADER_DEPTH 7 //8 16 | 17 | #endif //SHADERDEFINITIONS_H 18 | -------------------------------------------------------------------------------- /VolViewer/src/Sobel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef SOBEL_H 6 | #define SOBEL_H 7 | 8 | #define SOBEL_HORIZ 0 9 | #define SOBEL_VERTI 1 10 | #define SOBEL_DEPTH 2 11 | #define SOBEL_HV 3 12 | #define SOBEL_HVD 4 13 | #define SOBEL_HVDIAG 5 14 | 15 | class Sobel 16 | { 17 | public: 18 | 19 | double sobelX3d[3][3][3]; 20 | double sobelY3d[3][3][3]; 21 | double sobelZ3d[3][3][3]; 22 | 23 | double sobelX2d[3][3]; 24 | double sobelY2d[3][3]; 25 | 26 | Sobel(); 27 | ~Sobel(); 28 | }; 29 | #endif //SOBEL_H -------------------------------------------------------------------------------- /VolViewer/src/TfuncState.cpp: -------------------------------------------------------------------------------- 1 | #include "TfuncState.h" 2 | 3 | TfuncState::TfuncState() 4 | { 5 | brightness = 100; 6 | contrast = 100; 7 | threshold_min = 0; 8 | threshold_max = 255; 9 | } 10 | TfuncState::~TfuncState() 11 | { 12 | clear(); 13 | } 14 | void TfuncState::clear(void) 15 | { 16 | functioneditor.clear(); 17 | } 18 | void TfuncState::init(float s, int b, int o, int bright, int cont, int min, int max) 19 | { 20 | functioneditor_size = s; 21 | functioneditor_border = b; 22 | functioneditor_offset = o; 23 | functioneditor.init(functioneditor_size, functioneditor_border, functioneditor_offset); 24 | 25 | brightness = bright; 26 | contrast = cont; 27 | threshold_min = min; 28 | threshold_max = max; 29 | } 30 | void TfuncState::reset(void) 31 | { 32 | brightness = 100; 33 | contrast = 100; 34 | threshold_min = 0; 35 | threshold_max = 255; 36 | 37 | functioneditor.reset(); 38 | } 39 | void TfuncState::save(ofstream& fout) 40 | { 41 | fout.precision(10); 42 | fout.setf(ios::fixed); 43 | 44 | fout< 9 | #include 10 | using namespace std; 11 | 12 | #include "FunctionEditor.h" 13 | 14 | class TfuncState 15 | { 16 | public: 17 | 18 | float functioneditor_size; 19 | int functioneditor_border; 20 | int functioneditor_offset; 21 | FunctionEditor functioneditor; 22 | 23 | int brightness; 24 | int contrast; 25 | int threshold_min; 26 | int threshold_max; 27 | 28 | TfuncState(); 29 | ~TfuncState(); 30 | 31 | void clear(); 32 | void init(float s, int b, int o, int bright, int cont, int min, int max); 33 | void reset(void); 34 | 35 | void save(ofstream& fout); 36 | 37 | const TfuncState& operator= (const TfuncState& right); 38 | }; 39 | 40 | #endif // TFUNCSTATE_H 41 | -------------------------------------------------------------------------------- /VolViewer/src/Timer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #include "Timer.h" 6 | 7 | Timer::Timer() 8 | { 9 | fps_count = 0; 10 | fps_time = 0; 11 | fps = 0; 12 | } 13 | void Timer::startFPS(void) 14 | { 15 | fps_start = QTime::currentTime(); 16 | } 17 | float Timer::endFPS(void) 18 | { 19 | float deltaT; 20 | fps_end = QTime::currentTime(); 21 | deltaT = fps_start.msecsTo(fps_end); 22 | fps_time += deltaT; 23 | fps_count++; 24 | 25 | if (fps_count >= 10) 26 | { 27 | fps = (fps_count / fps_time) * 1000.0f; 28 | fps_time = 0.0; 29 | fps_count = 0; 30 | } 31 | 32 | return fps; 33 | } 34 | void Timer::startTimer(void) 35 | { 36 | start = QTime::currentTime(); 37 | } 38 | float Timer::endTimer(QString msg) 39 | { 40 | end = QTime::currentTime(); 41 | 42 | float elapsed_time = start.msecsTo(end); 43 | 44 | printf("%s - elapsed_time = %f (ms)\n", msg.latin1(), elapsed_time); 45 | 46 | return elapsed_time; 47 | } 48 | 49 | -------------------------------------------------------------------------------- /VolViewer/src/Timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef TIMER_H 6 | #define TIMER_H 7 | 8 | #include 9 | #include 10 | #include 11 | using namespace std; 12 | 13 | class Timer 14 | { 15 | public: 16 | 17 | QTime start; 18 | QTime end; 19 | float deltaTime; 20 | 21 | QTime fps_start; 22 | QTime fps_end; 23 | float fps; 24 | int fps_count; // Frames per second count 25 | float fps_time; // Frames per second time 26 | 27 | //------------------------------------------------------------------- 28 | Timer(); 29 | 30 | void startFPS(void); 31 | float endFPS(void); 32 | 33 | void startTimer(void); 34 | float endTimer(QString msg); 35 | }; 36 | 37 | #endif //TIMER 38 | -------------------------------------------------------------------------------- /VolViewer/src/Triangulate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef TRIANGULATE_H 6 | #define TRIANGULATE_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include // Include STL vector class. 13 | 14 | using namespace std; 15 | 16 | #include "Vector.h" 17 | 18 | class Triangulate 19 | { 20 | public: 21 | 22 | static void Sort(vector< Vector > points,vector< Vector > &sorted_points, Vector vn); 23 | 24 | // triangulate a contour/polygon, places results in STL vector 25 | // as series of triangles. 26 | static bool Process(const vector< Vector > &contour, 27 | vector< Vector > &result); 28 | 29 | // compute area of a contour/polygon 30 | static float Area(const vector< Vector > &contour); 31 | 32 | // decide if point Px/Py is inside triangle defined by 33 | // (Ax,Ay) (Bx,By) (Cx,Cy) 34 | static bool InsideTriangle(float Ax, float Ay, 35 | float Bx, float By, 36 | float Cx, float Cy, 37 | float Px, float Py); 38 | private: 39 | static bool Snip(const vector< Vector > &contour,int u,int v,int w,int n,int *V); 40 | 41 | }; 42 | 43 | #endif //TRIANGULATE_H -------------------------------------------------------------------------------- /VolViewer/src/VolViewer.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/src/VolViewer.ico -------------------------------------------------------------------------------- /VolViewer/src/VolViewer.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "VolViewer.ico" -------------------------------------------------------------------------------- /VolViewer/src/VolViewer.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/src/VolViewer.res -------------------------------------------------------------------------------- /VolViewer/src/VolumeObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef VOLOBJ_H 6 | #define VOLOBJ_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include "MyDefines.h" 14 | 15 | #ifdef LIBTIFF_SUPPORT 16 | #include 17 | #include 18 | #endif 19 | 20 | #include "Vector.h" 21 | 22 | class VolumeObject 23 | { 24 | 25 | public: 26 | 27 | GLuint TEXTURE3D_RED; 28 | GLuint TEXTURE3D_GREEN; 29 | GLuint TEXTURE3D_BLUE; 30 | 31 | Q3ProgressDialog* progressbar; 32 | 33 | float maxsize; 34 | float xsize, ysize, zsize; 35 | float xscale, yscale, zscale; 36 | float x_resize, y_resize, z_resize; 37 | 38 | int maxres; 39 | int maxsizeX, maxsizeY, maxsizeZ; 40 | 41 | int resized_texwidth, resized_texheight, resized_texdepth; 42 | 43 | Vector boundingboxCentre; 44 | Vector boundingboxSize; 45 | Vector boundingboxMin; 46 | Vector boundingboxMax; 47 | 48 | //filename of our data and type 49 | QString file_name; 50 | int file_type; 51 | 52 | //original dimensions of volume & volume array 53 | float maxdimension; 54 | int width, height, depth; 55 | 56 | //dimensions of texture array & texture array 57 | int texwidth, texheight, texdepth; 58 | 59 | bool is_greyscale; 60 | bool has_red, has_green, has_blue; 61 | unsigned char* texture3d; 62 | 63 | #ifdef LIBTIFF_SUPPORT 64 | bool is16bit; 65 | int voldatasize; 66 | uint16** voldata; 67 | double histogram16bit[65536]; 68 | #endif 69 | 70 | //histogram of our object 71 | double histogram[256*3]; 72 | 73 | VolumeObject(); 74 | ~VolumeObject(); 75 | 76 | Vector get_index3D(int index); 77 | int get_index1DinBoundingBox(int x, int y, int z); 78 | int get_index1D(int x, int y, int z); 79 | void resize(float factor); 80 | int makepower2(int val); 81 | void resetBoundingBox(void); 82 | void compute_boundingbox(void); 83 | void compute_boundingbox_channel(int channel, int window_size); 84 | void compute_boundingbox_channel_bounded(int channel, int window_size); 85 | void compute_fastboundingbox_channel(Vector centre, int channel, int window_size, float sizefactor); 86 | void create_volume(void); 87 | 88 | int get_value(int index1d, int c); 89 | int get_value(int x, int y, int z, int c); 90 | void set_value(int x, int y, int z, int c, int value); 91 | void set_value(int index1d, int c, int value); 92 | 93 | Vector worldspacetoimagespace(Vector v); 94 | Vector imagespacetoworldspace(Vector v); 95 | 96 | const VolumeObject& operator= (const VolumeObject& right); 97 | }; 98 | 99 | #endif //VOLOBJ 100 | -------------------------------------------------------------------------------- /VolViewer/src/VolumeRenderView.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifndef VOLRENVIEW_H 6 | #define VOLRENVIEW_H 7 | 8 | #include "Vector.h" 9 | #include "ArcBall.h" 10 | #include "Camera.h" 11 | #include "PlaneWidgetInCube.h" 12 | #include "PlaneWidget.h" 13 | #include "TfuncState.h" 14 | 15 | #define PERSP_PROJECTION 0 16 | #define ORTHO_PROJECTION 1 17 | 18 | class VolumeRenderView 19 | { 20 | 21 | public: 22 | 23 | int projection_toggle; 24 | 25 | int mouse_active; 26 | Vector mouse_current; 27 | Vector mouse_centre; 28 | 29 | //our bounding box (8 vertices) 30 | Vector bb_v1, bb_v2, bb_v3, bb_v4, bb_v5, bb_v6, bb_v7, bb_v8; 31 | 32 | //clipping planes 33 | PlaneWidgetInCube cutting_planes; 34 | int plane_rendermode[6]; 35 | 36 | //used for mouse click unproject in qtglwidget 37 | double mvmatrix[16]; 38 | double projmatrix[16]; 39 | int viewport[4]; 40 | 41 | //camera interaction 42 | ArcBall arcball; 43 | 44 | //viewing parameters 45 | Camera camera; 46 | float zoom; 47 | 48 | Vector up; 49 | Vector eye; 50 | Vector at; 51 | 52 | //tx, ty in texture space 53 | Vector tex_translate; 54 | 55 | // window dimensions 56 | int winWidth, winHeight, winMaxDim; 57 | 58 | //transfer function 59 | TfuncState luminance; 60 | TfuncState alpha; 61 | TfuncState redluminance; 62 | TfuncState redalpha; 63 | TfuncState greenluminance; 64 | TfuncState greenalpha; 65 | TfuncState blueluminance; 66 | TfuncState bluealpha; 67 | 68 | bool redclip_toggle, blueclip_toggle, greenclip_toggle; 69 | 70 | VolumeRenderView(); 71 | ~VolumeRenderView(); 72 | 73 | void rotateX(float angle); 74 | void rotateY(float angle); 75 | void rotateZ(float angle); 76 | 77 | void move_left(float amount); 78 | void move_up(float amount); 79 | void move_forward(float amount); 80 | 81 | void pitchUp(float angle); 82 | void headingLeft(float angle); 83 | 84 | void lookat(void); 85 | 86 | void mouse_move(QMouseEvent* e); 87 | void mouse_press(QMouseEvent* e); 88 | void mouse_release(void); 89 | void mouseRotate(double x_angle, double y_angle); 90 | void mouseLook( double heading_angle, double pitch_angle); 91 | 92 | void reset_view(); 93 | void reset_zoom(); 94 | void reset_translate(); 95 | 96 | void load(QString fn); 97 | void load_version0(QString fn); 98 | void load_version1(QString fn); 99 | float check_file_version(QString fn); 100 | 101 | void save(QString fn); 102 | void save(ofstream& fout); 103 | 104 | const VolumeRenderView& operator= (const VolumeRenderView& right); 105 | }; 106 | 107 | #endif //VOLRENVIEW_H -------------------------------------------------------------------------------- /VolViewer/src/VolumeScript.h: -------------------------------------------------------------------------------- 1 | #ifndef VOLUMESCRIPT_H 2 | #define VOLUMESCRIPT_H 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | #include "MyDefines.h" 11 | #include "ShaderDefinitions.h" 12 | #include "Filter.h" 13 | 14 | class QtMainWindow; 15 | 16 | class VolumeScript 17 | { 18 | public: 19 | 20 | vector< bool > channels; 21 | bool uploadTexture; 22 | Filter filter; 23 | 24 | bool omero_batch; 25 | bool image_batch; 26 | 27 | bool recursive_folders; 28 | 29 | QtMainWindow* mw; 30 | 31 | QString current_working_folder; 32 | 33 | QStringList now_commands; 34 | QStringList atquit_commands; 35 | 36 | int current_image_index; 37 | QStringList open_images_path; 38 | QStringList open_images_path_only; 39 | QStringList open_images_path_relative; 40 | 41 | int current_omeroimage_index; 42 | vector omero_image_ids; 43 | 44 | VolumeScript(); 45 | ~VolumeScript(); 46 | 47 | bool checkPath(QString path); 48 | QString fixPath(QString path); 49 | bool createPath(QString path); 50 | bool checkFile(QString filepath, QString extension); 51 | QString removeFunctionName(QString str, QString funcname); 52 | bool checkFuncArgs(QStringList* argus, int expected_siz, QString funcname); 53 | 54 | void parse_script(QString commands); 55 | void execute_script_now(void); 56 | void execute_script_at_quit(void); 57 | bool setupchannels(int offset); 58 | 59 | void interpret_script(QStringList commandList); 60 | 61 | void parse_images_folder(QString path, bool recurs); 62 | 63 | void open_events(QString command); 64 | void close_events(QString command); 65 | void save_events(QString command); 66 | void wait_events(QString command); 67 | void set_events(QString command); 68 | void movie_events(QString command); 69 | void commpute_events(QString command); 70 | 71 | void filter_start(void); 72 | void filter_end(void); 73 | 74 | void next_image(int mode); 75 | void next_omeroimage(int mode); 76 | }; 77 | 78 | #endif //VOLUMESCRIPT_H -------------------------------------------------------------------------------- /VolViewer/src/build_linux.sh: -------------------------------------------------------------------------------- 1 | export ICE_HOME=/opt/Ice-3.3 2 | export OMERO_HOME=/opt/OMERO.cpp-Beta-4.3.4/OMERO.cpp-4.3.4-posix-gcc-4.4.4-64rel 3 | #export LIBTIFF_HOME=/libtiff/path 4 | #export OPENCL_HOME=/opencl/path 5 | qmake src.pro 6 | make 7 | -------------------------------------------------------------------------------- /VolViewer/src/build_mac.sh: -------------------------------------------------------------------------------- 1 | export ICE_HOME=/Users/ut/Documents/SVN/omero-4.2.2/Ice-3.3.1-64 2 | export OMERO_HOME=/Users/ut/Documents/SVN/OMERO4.2.2 3 | export LIBTIFF_HOME=/libtiff/path 4 | export OPENCL_HOME=/opencl/path 5 | qmake -spec macx-g++ src.pro 6 | make -------------------------------------------------------------------------------- /VolViewer/src/build_win.bat: -------------------------------------------------------------------------------- 1 | @echo ==============================================================- 2 | @echo (NB) Remember to edit the paths/variables by editing the file! 3 | @echo ==============================================================- 4 | 5 | Set QMAKESPEC=C:\Qt\Qt4.7.4_x86\mkspecs\win32-msvc2010 6 | Set QMAKEPATH=C:\Qt\Qt4.7.4_x86\bin 7 | Set NMAKEPATH=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin 8 | Set ICE_HOME=C:\Ice-3.3.1-VC90\ 9 | Set OMERO_HOME=E:\SVN\-=OMERO_DEV=-\OMEROLIB 4.2.2\ 10 | 11 | Set PATH=%QMAKEPATH%;%NMAKEPATH%;%PATH% 12 | 13 | qmake src.pro 14 | nmake 15 | pause -------------------------------------------------------------------------------- /VolViewer/src/gl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Jerome Avondo. All rights reserved. 3 | * Use is subject to license terms supplied in LICENSE.txt 4 | */ 5 | #ifdef __APPLE__ 6 | # include 7 | #else 8 | //# include 9 | #include 10 | #endif -------------------------------------------------------------------------------- /VolViewer/src/libtiff/src/tiff-3.9.5.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/src/libtiff/src/tiff-3.9.5.zip -------------------------------------------------------------------------------- /VolViewer/src/libtiff/tif_config.h: -------------------------------------------------------------------------------- 1 | /* Define to 1 if you have the header file. */ 2 | #define HAVE_ASSERT_H 1 3 | 4 | /* Define to 1 if you have the header file. */ 5 | #define HAVE_FCNTL_H 1 6 | 7 | /* Define as 0 or 1 according to the floating point format suported by the 8 | machine */ 9 | #define HAVE_IEEEFP 1 10 | 11 | /* Define to 1 if you have the `jbg_newlen' function. */ 12 | #define HAVE_JBG_NEWLEN 1 13 | 14 | /* Define to 1 if you have the header file. */ 15 | #define HAVE_STRING_H 1 16 | 17 | /* Define to 1 if you have the header file. */ 18 | #define HAVE_SYS_TYPES_H 1 19 | 20 | /* Define to 1 if you have the header file. */ 21 | #define HAVE_IO_H 1 22 | 23 | /* Define to 1 if you have the header file. */ 24 | #define HAVE_SEARCH_H 1 25 | 26 | /* Define to 1 if you have the `setmode' function. */ 27 | #define HAVE_SETMODE 1 28 | 29 | /* The size of a `int', as computed by sizeof. */ 30 | #define SIZEOF_INT 4 31 | 32 | /* The size of a `long', as computed by sizeof. */ 33 | #define SIZEOF_LONG 4 34 | 35 | /* Signed 64-bit type */ 36 | #define TIFF_INT64_T signed __int64 37 | 38 | /* Unsigned 64-bit type */ 39 | #define TIFF_UINT64_T unsigned __int64 40 | 41 | /* Set the native cpu bit order */ 42 | #define HOST_FILLORDER FILLORDER_LSB2MSB 43 | 44 | /* Define to 1 if your processor stores words with the most significant byte 45 | first (like Motorola and SPARC, unlike Intel and VAX). */ 46 | /* #undef WORDS_BIGENDIAN */ 47 | 48 | /* Define to `__inline__' or `__inline' if that's what the C compiler 49 | calls it, or to nothing if 'inline' is not supported under any name. */ 50 | #ifndef __cplusplus 51 | # ifndef inline 52 | # define inline __inline 53 | # endif 54 | #endif 55 | 56 | #define lfind _lfind 57 | /* 58 | * Local Variables: 59 | * mode: c 60 | * c-basic-offset: 8 61 | * fill-column: 78 62 | * End: 63 | */ 64 | -------------------------------------------------------------------------------- /VolViewer/src/libtiff/tif_config.vc.h: -------------------------------------------------------------------------------- 1 | /* Define to 1 if you have the header file. */ 2 | #define HAVE_ASSERT_H 1 3 | 4 | /* Define to 1 if you have the header file. */ 5 | #define HAVE_FCNTL_H 1 6 | 7 | /* Define as 0 or 1 according to the floating point format suported by the 8 | machine */ 9 | #define HAVE_IEEEFP 1 10 | 11 | /* Define to 1 if you have the `jbg_newlen' function. */ 12 | #define HAVE_JBG_NEWLEN 1 13 | 14 | /* Define to 1 if you have the header file. */ 15 | #define HAVE_STRING_H 1 16 | 17 | /* Define to 1 if you have the header file. */ 18 | #define HAVE_SYS_TYPES_H 1 19 | 20 | /* Define to 1 if you have the header file. */ 21 | #define HAVE_IO_H 1 22 | 23 | /* Define to 1 if you have the header file. */ 24 | #define HAVE_SEARCH_H 1 25 | 26 | /* Define to 1 if you have the `setmode' function. */ 27 | #define HAVE_SETMODE 1 28 | 29 | /* The size of a `int', as computed by sizeof. */ 30 | #define SIZEOF_INT 4 31 | 32 | /* The size of a `long', as computed by sizeof. */ 33 | #define SIZEOF_LONG 4 34 | 35 | /* Signed 64-bit type */ 36 | #define TIFF_INT64_T signed __int64 37 | 38 | /* Unsigned 64-bit type */ 39 | #define TIFF_UINT64_T unsigned __int64 40 | 41 | /* Set the native cpu bit order */ 42 | #define HOST_FILLORDER FILLORDER_LSB2MSB 43 | 44 | /* Define to 1 if your processor stores words with the most significant byte 45 | first (like Motorola and SPARC, unlike Intel and VAX). */ 46 | /* #undef WORDS_BIGENDIAN */ 47 | 48 | /* Define to `__inline__' or `__inline' if that's what the C compiler 49 | calls it, or to nothing if 'inline' is not supported under any name. */ 50 | #ifndef __cplusplus 51 | # ifndef inline 52 | # define inline __inline 53 | # endif 54 | #endif 55 | 56 | #define lfind _lfind 57 | /* 58 | * Local Variables: 59 | * mode: c 60 | * c-basic-offset: 8 61 | * fill-column: 78 62 | * End: 63 | */ 64 | -------------------------------------------------------------------------------- /VolViewer/src/libtiff/tif_config.wince.h: -------------------------------------------------------------------------------- 1 | /* $Id: tif_config.wince.h,v 1.1.2.1 2010-06-08 18:50:41 bfriesen Exp $ */ 2 | 3 | /* 4 | * TIFF library configuration header for Windows CE platform. 5 | */ 6 | #ifndef _WIN32_WCE 7 | # error This version of tif_config.h header is dedicated for Windows CE platform! 8 | #endif 9 | 10 | /* Define to 1 if you have the header file. */ 11 | #define HAVE_ASSERT_H 1 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #define HAVE_FCNTL_H 1 15 | 16 | /* Define as 0 or 1 according to the floating point format suported by the 17 | machine */ 18 | #define HAVE_IEEEFP 1 19 | 20 | /* Define to 1 if you have the `jbg_newlen' function. */ 21 | #define HAVE_JBG_NEWLEN 1 22 | 23 | /* Define to 1 if you have the header file. */ 24 | #define HAVE_STRING_H 1 25 | 26 | /* Define to 1 if you have the header file. */ 27 | #undef HAVE_SYS_TYPES_H 28 | 29 | /* Define to 1 if you have the header file. */ 30 | #define HAVE_IO_H 1 31 | 32 | /* Define to 1 if you have the header file. */ 33 | #define HAVE_SEARCH_H 1 34 | 35 | /* Define to 1 if you have the `setmode' function. */ 36 | #define HAVE_SETMODE 1 37 | 38 | /* Define to 1 if you have the `bsearch' function. */ 39 | #define HAVE_BSEARCH 1 40 | #define bsearch wceex_bsearch 41 | 42 | /* Define to 1 if you have the `lfind' function. */ 43 | #define HAVE_LFIND 1 44 | #define lfind wceex_lfind 45 | 46 | /* The size of a `int', as computed by sizeof. */ 47 | #define SIZEOF_INT 4 48 | 49 | /* The size of a `long', as computed by sizeof. */ 50 | #define SIZEOF_LONG 4 51 | 52 | /* Set the native cpu bit order */ 53 | #define HOST_FILLORDER FILLORDER_LSB2MSB 54 | 55 | /* Define to 1 if your processor stores words with the most significant byte 56 | first (like Motorola and SPARC, unlike Intel and VAX). */ 57 | /* #undef WORDS_BIGENDIAN */ 58 | 59 | /* Define to `__inline__' or `__inline' if that's what the C compiler 60 | calls it, or to nothing if 'inline' is not supported under any name. */ 61 | #ifndef __cplusplus 62 | # ifndef inline 63 | # define inline __inline 64 | # endif 65 | #endif 66 | 67 | 68 | /* 69 | * Local Variables: 70 | * mode: c 71 | * c-basic-offset: 8 72 | * fill-column: 78 73 | * End: 74 | */ 75 | -------------------------------------------------------------------------------- /VolViewer/src/libtiff/tiffvers.h: -------------------------------------------------------------------------------- 1 | #define TIFFLIB_VERSION_STR "LIBTIFF, Version 3.9.5\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc." 2 | /* 3 | * This define can be used in code that requires 4 | * compilation-related definitions specific to a 5 | * version or versions of the library. Runtime 6 | * version checking should be done based on the 7 | * string returned by TIFFGetVersion. 8 | */ 9 | #define TIFFLIB_VERSION 20110409 10 | -------------------------------------------------------------------------------- /VolViewer/src/macosx_build.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ut666/VolViewer/eb296e385fbbf48513de0b667c617024173b5812/VolViewer/src/macosx_build.sh -------------------------------------------------------------------------------- /VolViewer/src/maxflow_instances.inc: -------------------------------------------------------------------------------- 1 | #include "maxflow_graph.h" 2 | 3 | #ifndef GRAPHTEMPLATES_INC 4 | #define GRAPHTEMPLATES_INC 5 | 6 | #ifdef _MSC_VER 7 | #pragma warning(disable: 4661) 8 | #endif 9 | 10 | // Instantiations: 11 | // IMPORTANT: 12 | // flowtype should be 'larger' than tcaptype 13 | // tcaptype should be 'larger' than captype 14 | 15 | template class Graph; 16 | template class Graph; 17 | template class Graph; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /VolViewer/src/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by myapp.rc 4 | // 5 | 6 | // Next default values for new objects 7 | // 8 | #ifdef APSTUDIO_INVOKED 9 | #ifndef APSTUDIO_READONLY_SYMBOLS 10 | #define _APS_NEXT_RESOURCE_VALUE 101 11 | #define _APS_NEXT_COMMAND_VALUE 40001 12 | #define _APS_NEXT_CONTROL_VALUE 1000 13 | #define _APS_NEXT_SYMED_VALUE 101 14 | #endif 15 | #endif 16 | -------------------------------------------------------------------------------- /VolViewer2.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual Studio 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VolViewer", "VolViewer\VolViewer.vcproj", "{2096D454-8C4D-474E-B4DD-D085BB12E2EF}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug_OMERO|Win32 = Debug_OMERO|Win32 9 | Debug_OMERO|x64 = Debug_OMERO|x64 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Debug_OMERO|Win32.ActiveCfg = Debug_OMERO|Win32 17 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Debug_OMERO|Win32.Build.0 = Debug_OMERO|Win32 18 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Debug_OMERO|x64.ActiveCfg = Debug_OMERO|x64 19 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Debug_OMERO|x64.Build.0 = Debug_OMERO|x64 20 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Debug|Win32.ActiveCfg = Debug|Win32 21 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Debug|Win32.Build.0 = Debug|Win32 22 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Debug|x64.ActiveCfg = Debug|x64 23 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Debug|x64.Build.0 = Debug|x64 24 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Release|Win32.ActiveCfg = Release|Win32 25 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Release|Win32.Build.0 = Release|Win32 26 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Release|x64.ActiveCfg = Release|x64 27 | {2096D454-8C4D-474E-B4DD-D085BB12E2EF}.Release|x64.Build.0 = Release|x64 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /VolViewer32bit.nsi: -------------------------------------------------------------------------------- 1 | ; VolViewerInstaller.nsi 2 | ; 3 | ; Nullsoft Scriptable Install System 4 | ; 5 | ; Custom script for the VolViewer Application 6 | ; author: Jerome Avondo 7 | ;-------------------------------- 8 | 9 | ; The name of the installer 10 | Name "VolViewer - 32bit" 11 | 12 | ; The file to write 13 | OutFile "VolViewerInstaller_x86.exe" 14 | 15 | ; The default installation directory 16 | InstallDir $PROGRAMFILES\VolViewer 17 | 18 | ; The text to prompt the user to enter a directory 19 | DirText "This will install the VolViewer application on your computer. Please choose a directory" 20 | 21 | ;-------------------------------- 22 | 23 | ; The stuff to install 24 | Section "" ;No components page, name is not important 25 | 26 | ; Set output path to the installation directory. 27 | ; Put file there 28 | SetOutPath $INSTDIR 29 | File 32bitInstall\VolViewer.exe 30 | File 32bitInstall\*.dll 31 | File 32bitInstall\settings.ini 32 | SetOutPath $INSTDIR\imageformats 33 | File 32bitInstall\imageformats\*.* 34 | SetOutPath $INSTDIR\Icons 35 | File 32bitInstall\Icons\*.* 36 | SetOutPath $INSTDIR\Shaders 37 | File 32bitInstall\Shaders\*.* 38 | SetOutPath $INSTDIR\Kernels 39 | File 32bitInstall\Kernels\*.* 40 | SetOutPath $INSTDIR 41 | 42 | ; Now create shortcuts 43 | CreateDirectory "$SMPROGRAMS\VolViewer" 44 | CreateShortCut "$SMPROGRAMS\VolViewer\VolViewer.lnk" "$INSTDIR\VolViewer.exe" 45 | CreateShortCut "$SMPROGRAMS\VolViewer\Edit Settings.lnk" "$INSTDIR\Settings.ini" 46 | CreateShortCut "$SMPROGRAMS\VolViewer\Uninstall.lnk" "$INSTDIR\Uninstall.exe" 47 | CreateShortCut "$DESKTOP\VolViewer.lnk" "$INSTDIR\VolViewer.exe" 48 | 49 | ; Tell the compiler to write an uninstaller and to look for a "Uninstall" section 50 | WriteUninstaller $INSTDIR\Uninstall.exe 51 | 52 | SectionEnd ; end the section 53 | 54 | ; The uninstall section 55 | Section "Uninstall" 56 | 57 | ; Delete the files and folders 58 | Delete $INSTDIR\*.* 59 | Delete $INSTDIR\Icons\*.* 60 | Delete $INSTDIR\Shaders\*.* 61 | Delete $INSTDIR\Kernels\*.* 62 | Delete $INSTDIR\imageformats\*.* 63 | RMDir $INSTDIR\Icons 64 | RMDir $INSTDIR\Shaders 65 | RMDir $INSTDIR\Kernels 66 | RMDir $INSTDIR\imageformats 67 | RMDir $INSTDIR 68 | 69 | ;Now remove shortcuts too 70 | Delete "$SMPROGRAMS\VolViewer\Uninstall.lnk" 71 | Delete "$SMPROGRAMS\VolViewer\Edit Settings.lnk" 72 | Delete "$SMPROGRAMS\VolViewer\VolViewer.lnk" 73 | RMDir "$SMPROGRAMS\VolViewer" 74 | Delete "$DESKTOP\VolViewer.lnk" 75 | 76 | SectionEnd -------------------------------------------------------------------------------- /VolViewer64bit.nsi: -------------------------------------------------------------------------------- 1 | ; VolViewerInstaller.nsi 2 | ; 3 | ; Nullsoft Scriptable Install System 4 | ; 5 | ; Custom script for the VolViewer Application 6 | ; author: Jerome Avondo 7 | ;-------------------------------- 8 | 9 | ; The name of the installer 10 | Name "VolViewer - 64bit" 11 | 12 | ; The file to write 13 | OutFile "VolViewerInstaller_x64.exe" 14 | 15 | ; The default installation directory 16 | InstallDir $PROGRAMFILES64\VolViewer 17 | 18 | ; The text to prompt the user to enter a directory 19 | DirText "This will install the VolViewer application on your computer. Please choose a directory" 20 | 21 | ;-------------------------------- 22 | 23 | ; The stuff to install 24 | Section "" ;No components page, name is not important 25 | 26 | ; Set output path to the installation directory. 27 | ; Put file there 28 | SetOutPath $INSTDIR 29 | File 64bitInstall\VolViewer.exe 30 | File 64bitInstall\*.dll 31 | File 64bitInstall\settings.ini 32 | SetOutPath $INSTDIR\imageformats 33 | File 64bitInstall\imageformats\*.* 34 | SetOutPath $INSTDIR\Icons 35 | File 64bitInstall\Icons\*.* 36 | SetOutPath $INSTDIR\Shaders 37 | File 64bitInstall\Shaders\*.* 38 | SetOutPath $INSTDIR\Kernels 39 | File 32bitInstall\Kernels\*.* 40 | SetOutPath $INSTDIR 41 | 42 | ; Now create shortcuts 43 | CreateDirectory "$SMPROGRAMS\VolViewer" 44 | CreateShortCut "$SMPROGRAMS\VolViewer\VolViewer.lnk" "$INSTDIR\VolViewer.exe" 45 | CreateShortCut "$SMPROGRAMS\VolViewer\Edit Settings.lnk" "$INSTDIR\Settings.ini" 46 | CreateShortCut "$SMPROGRAMS\VolViewer\Uninstall.lnk" "$INSTDIR\Uninstall.exe" 47 | CreateShortCut "$DESKTOP\VolViewer.lnk" "$INSTDIR\VolViewer.exe" 48 | 49 | ; Tell the compiler to write an uninstaller and to look for a "Uninstall" section 50 | WriteUninstaller $INSTDIR\Uninstall.exe 51 | 52 | SectionEnd ; end the section 53 | 54 | ; The uninstall section 55 | Section "Uninstall" 56 | 57 | ; Delete the files and folders 58 | Delete $INSTDIR\*.* 59 | Delete $INSTDIR\Icons\*.* 60 | Delete $INSTDIR\Shaders\*.* 61 | Delete $INSTDIR\Kernels\*.* 62 | Delete $INSTDIR\imageformats\*.* 63 | RMDir $INSTDIR\Icons 64 | RMDir $INSTDIR\Shaders 65 | RMDir $INSTDIR\Kernels 66 | RMDir $INSTDIR\imageformats 67 | RMDir $INSTDIR 68 | 69 | ;Now remove shortcuts too 70 | Delete "$SMPROGRAMS\VolViewer\Uninstall.lnk" 71 | Delete "$SMPROGRAMS\VolViewer\Edit Settings.lnk" 72 | Delete "$SMPROGRAMS\VolViewer\VolViewer.lnk" 73 | RMDir "$SMPROGRAMS\VolViewer" 74 | Delete "$DESKTOP\VolViewer.lnk" 75 | 76 | SectionEnd --------------------------------------------------------------------------------