Unable to save data file to output filepath that contains a % character
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 28/100
Línea de trabajo
Empieza reproduciendo el caso reportado con el ejemplo de Python y, después, inspecciona src/metaImage.cxx alrededor del código enlazado de gestión de rutas. Traza cómo se interpreta % para la salida de un slice por archivo y determina la cobertura de pruebas existente, si la hay. Se considera terminado cuando el comportamiento solicitado de la ruta de archivo está implementado o la limitación está documentada, y el archivo de datos del volumen se ha guardado como se esperaba.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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)}")
- Lenguaje dominante
- C
- Estrellas
- 32
- Forks
- 26
- Merge medio
- 2 h 40 min
- PR fusionados (30 d)
- 4
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Kitware/MetaIO
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 32/100
-
Update CIAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
Todos los issues de Kitware/MetaIO
Issues similares
-
Linux notifications: the default action's ' ' label shows as a blank button in xfce4-notifydAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
kovidgoyal/kitty#10625 ·
Los mantenedores suelen responder en 1 día
-
Feature Status: Needs Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
Los mantenedores suelen responder en 1 día
-
docs
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
RubyMetric/chsrc#396 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
riscv-software-src/riscv-isa-sim#2466 ·
Los mantenedores suelen responder en 1 día