A web-based segment viewer for Vesuvius Challenge
This is a web-based segment viewer which you can visualize the scroll data from Vesuvius Challenge on the top of Three.js library.
Clone this repository
git clone https://github.com/tomhsiao1260/segment-viewer.git
cd segment-viewerSetup a virtual environment and activate it
python -m venv env
source env/bin/activateInstall the reqired python packages
pip install -r requirements.txtDownload Node.js and install the required npm packages
cd client && npm installWe need to give this repo the data you want to see. Open config.json file in root directory and write down the corresponding config. TIF_INPUT and TIF_SMALL_INPUT is the .tif files directory. OBJ_INPUT is the segmentation .obj paths directory.
OBJ_INPUT : "../full-scrolls/Scroll1.volpkg/paths",
TIF_INPUT : "../full-scrolls/Scroll1.volpkg/volumes/20230205180739",
TIF_SMALL_INPUT : "../full-scrolls/Scroll1.volpkg/volumes_small/20230205180739"And MAX_LAYER means number of layers in TIF_INPUT folder. WIDTH and HEIGHT are the pixel sizes of each .tif image.
MAX_LAYER: 14375
WIDTH: 8096
HEIGHT: 7888There's a file called volume.py for converting the .tif data into multiple chunks which can be used for rendering via this application. Another file called segment.py which can handle segment .obj files we need. Let's run these python scripts. It may take a while. Once finished, you will find some .obj and .tif files generated in ./output/segment and ./output/volume folder, respectively.
python segment.py
python volume.pyNow, eveything is set. Let's serve this web application and navigate to http://localhost:5173/. It may take a few seconds to load assets, but hopefully you can see the results. Have fun!
cd client && npm run dev