Comments (4)
tiff fileをdecodeするライブラリについて
良いライブラリが見つからない
- tiff: class-propertiesを使っている(他にもcreate react appがデフォルトでサポートしていない記法を使っているかも)ので、下記のどちらかの方法で設定を変更する必要がある
- ejectする(不可逆)
- create-react-app-rewiredを使う
- geotiff: jsで記述されていて、@types/geotiffが提供されていないのでcompileできない
- JImp: File オブジェクトからreadできない
複数ページの表示について
- 通常のカルーセル表示を行うライブラリはimgタグで画像を表示している
- imgタグで画像を表示するには
- 画像ファイルへのpathを指定する
- 画像を表現するarrayBufferオブジェクトへの参照をsrcに指定する
- tiff -> png / jpeg etc. の変換をjavascriptで実行してそのまま表示するので、2の方法でできるはず(tiffの中の全画像をファイルに書き出すのは時間がかかる?)
- 2の方法でカルーセル表示するライブラリを見つけられていない
from optinist.
yarn run eject
せずに設定を変更する
- react-app-rewired とcustomize-craをインストール
- package.jsonの
start
,build
,test
scriptをreact-app-rewiredで実行するように変更 - config-override.jsを作成
- config-override.jsに追加ルールを記述
class-propertyの許可
- @babel/plugin-syntax-class-propertiesと@babel/plugin-proposal-class-propertiesをインストール
- config.ovveride.jsを下記の用に変更
const {
override,
addExternalBabelPlugin
} = require('customize-cra');
module.exports = override(
addExternalBabelPlugin('@babel/plugin-syntax-class-properties'),
addExternalBabelPlugin('@babel/plugin-proposal-class-properties'),
)
from optinist.
selectしたマルチページtiffファイルをブラウザでばらして表示する
- tiffを使ってselectで読み込んだファイルをdecode
- fast-pngを使ってdecodeしたデータをpngデータにencode
- pngにencodeしたデータを
window.URL.createObjectURL
に渡してimgタグで表示可能なオブジェクトへの参照を取得
によって表示させた結果が下記画像。
表示自体はできているが、表示内容がおかしい。tiffファイルによっては問題なく表示できるので、上手く対応できていないフォーマットのtiffファイルなのかも知れない。
from optinist.
方針変更
- ブラウザ側でオンメモリでtiffをdecode -> png画像にencodeするのに難航
- サーバーサイドでpng画像に変更する方向性を検討
- サーバーサイド(python)でも、tiffをオンメモリ(一度ファイルに吐き出さずに)でデコードすることを試したが、PillowやOpenCVのライブラリがその操作に対応していなかった
- サーバーサイドで、ブラウザから送信された画像を一度ファイルに保存してから読み込み直し、png画像にバラす方針とした
tiff画像の分割表示までの処理概要
- ブラウザでtiffファイルを選択してサーバー側にアップロード
- サーバー側で一度アップロードされたtiffファイルを保存
- 一度保存したtiffファイルを読み込み
- 読み込んだtiffファイルを1枚ずつpngに分割
- 静的ファイル配信ディレクトリ配下に、ランダムに生成した文字列のディレクトを作成し、分割したpngファイルを保存
- フロント側にランダムに生成した文字列を通知
- フロントは、サーバー側から通知された文字列をuriの一部として、分割後のファイルをリクエスト・表示
- サーバー側から通知された文字列がわからなければファイルにはアクセスできない
from optinist.
Related Issues (20)
- Request function: plot csv behavioural data
- Rename: ref image
- CCA should take any 2 matrices
- Requested feature: Data Selector
- ETA plot with correct xaxis limit
- LCCD RoiData cannot be used
- Adding new data requires rerun
- Delete ROIs from traces / Automatically select ROIs in map view when selecting fluorescence
- Cannot add ROIs from non_cell_roi HOT 1
- Cell ID turns to -1 when selecting
- Make clear which node each algorithm is working on
- Visualise Suite2p_registration output
- ETA heatmap cannot select ROIs
- Caiman_mc rois ??
- Deleting ROIs doesn't change analysis
- Probably unneeded parameters in suite2p_file nodes
- CaImAn parameters
- align_by_chan not possible to use
- HDF5 file inputs
- Cannot use caiman_cnmf with suite2p data
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from optinist.