Unable to save data file to output filepath that contains a % character
まだ誰も着手していません。
評価
調査の方向性
まず Python の例で報告されたケースを再現し、次にリンクされているパス処理コードの周辺にある src/metaImage.cxx を調べます。1 ファイルにつき 1 slice の出力で % がどのように解釈されるかを追跡し、既存のテストカバレッジがあれば確認します。要求されたファイルパスの動作が実装されるか、制限事項が文書化され、ボリュームデータファイルが期待どおりに保存されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
As originally posted about in https://discourse.slicer.org/t/failures-saving-a-volume-to-path-with-sign/25657 and more specifically in
https://discourse.slicer.org/t/failures-saving-a-volume-to-path-with-sign/25657/6 thanks to @lassoan:
MetaIO supports One-Slice-Per-File Data Formats 1 and it uses the % character to specify the slice number in the filename format string.
Due to the special meaning of the % character, currently MetaIO does not allow using this chracter in the path. This limitation should either be clearly documented or the implementation should be made more sophisticated (to somehow differentiate the % that refers to per-slice filename generation from simple % occurrences in the path; or by allowing completely disabling this extremely rarely used one-slice-per-file feature).
As such, % used in the basename could possibly still be treated with the special meaning for the filename format string for One-Slice-Per-File functionality however, % used elsewhere in the filepath should be supported. Last resort would be to document this limitation.
The below code uses 3D Slicer to show that the mhd file is written for a volume output filepath that contains a "%", but the corresponding data file (.zraw) is not written.
import os
import SampleData
volume_node = SampleData.SampleDataLogic().downloadMRHead()
output_filepath = os.path.join(os.getenv("USERPROFILE"), "Downloads", "2%concentration", "MyVolume.mhd")
slicer.util.saveNode(volume_node, output_filepath)
print(f"{output_filepath} exists?: {os.path.exists(output_filepath)}")
raw_filepath = os.path.splitext(output_filepath)[0] + '.zraw' # default Slicer saves it compressed hence zraw and not raw
print(f"{raw_filepath} exists?: {os.path.exists(raw_filepath)}")
- 主要言語
- C
- スター
- 32
- フォーク
- 26
- 平均マージ
- 2時間 40分
- マージ済み PR(30日)
- 4
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Kitware/MetaIO のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 32/100
-
Update CIオープン
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
メンテナーはふだん 3 日以内に返信
-
Type: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
espressif/idf-extra-components#870 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
EchoTools/nevr-runtime#171 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[P2] Workspace updates silently ignore forbidden assignments while staging the row対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信