원클릭으로
channel-tif-to-ome-tiff
Convert single-channel TIF directories to pyramidal OME-TIFF with SubIFDs
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Convert single-channel TIF directories to pyramidal OME-TIFF with SubIFDs
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Normalize long-form CODEX cycle folders to short form before notebooks run. Trigger: cyc001_reg001_*, hard-coded cyc paths breaking, staged CODEX raw data failing in Notebooks 1/2.
v5.6.0 joint multi-TF model: single model per symbol with broadcast 1Hour context replaces dual 15Min/1Hour models. Trigger: (1) replacing weighted-voting model aggregation, (2) adding broadcast features to vectorized env, (3) limited training data + worried about overfitting from doubling obs_dim, (4) backtest builder mismatch with newer feature counts.
DEPRECATED in v5.6.0 — see joint-multi-tf-v560 skill. Documents the v5.2.0 dual-model approach (train separate 15Min/1Hour models, combine via weighted voting). Still relevant for: (1) loading legacy v5.5.0 dual models, (2) understanding the historical aggregation layer, (3) resampling pattern via origin='start'.
Surface a shipped-but-undocumented CLI feature in user-facing docs. Trigger: user reports a known feature missing from README/readthedocs even though the CLI command exists.
KINTSUGI Snakefile + CLI changes that route SLURM jobs around accounts saturated by OTHER users on the same QOS pool. Trigger: QOSGrpMemLimit, jobs stuck pending despite available GPU slots in config, noisy neighbor on shared QOS, multi-user investment pool exhaustion, _build_cycle_assignment static-vs-live.
KINTSUGI SLURM batch processing: Maximize throughput using multi-account resource calculation with GPU+CPU pools per account. Trigger: SLURM job submission, batch processing, resource maximization, GPU+CPU concurrent, headless processing, resource pool.
| name | channel-tif-to-ome-tiff |
| description | Convert single-channel TIF directories to pyramidal OME-TIFF with SubIFDs |
| author | SpleenFollicleCounterQP |
| date | "2026-02-24T00:00:00.000Z" |
| Item | Details |
|---|---|
| Date | 2026-02-24 |
| Goal | Convert HiperGator signal-isolated channel TIFs into pyramidal OME-TIFF for QuPath |
| Environment | Python 3.12, tifffile, numpy; Linux |
| Status | Success |
HiperGator CODEX/Phenocycler processing outputs individual TIF files per channel (after signal isolation). These need to be consolidated into a single pyramidal OME-TIFF with proper metadata to be opened in QuPath v0.6.0 for downstream analysis.
python scripts/convert_to_ome_tiff.py <input_dir> <output_path> [--pixel-size 0.508]
def downsample_2x(img):
"""Block-mean 2x downsample, trimming odd dimensions."""
h, w = img.shape
img = img[:h - h % 2, :w - w % 2]
return img.reshape(h // 2, 2, w // 2, 2).mean(axis=(1, 3)).astype(np.uint16)
with tifffile.TiffWriter(output, bigtiff=True) as tw:
for i, (path, name) in enumerate(zip(channel_paths, names)):
img = tifffile.imread(str(path)).astype(np.uint16)
options = dict(tile=(512, 512), compression="deflate", subifds=4)
if i == 0:
options["description"] = ome_xml # OME-XML only on first page
options["metadata"] = None # CRITICAL: prevent auto-metadata
tw.write(img, **options)
# Write SubIFD pyramid levels
sub = downsample_2x(downsample_2x(img)) # 4x
del img
for level in range(4):
tw.write(sub, tile=(512, 512), compression="deflate", subfiletype=1)
if level < 3:
sub = downsample_2x(sub)
# MUST use XML entity µ for µ — tifffile requires 7-bit ASCII
xml = f'''...PhysicalSizeXUnit="µm"...'''
| Attempt | Why it Failed | Lesson Learned |
|---|---|---|
Using Unicode µm in OME-XML | ValueError: TIFF strings must be 7-bit ASCII — tifffile encodes description tag as ASCII | Use XML numeric entity µm instead of Unicode µ |
Not setting metadata=None on first page | tifffile adds its own metadata conflicting with OME-XML | Always pass metadata=None when providing custom description |
*.tif in input directoryBLANKDAPI-01 to DAPIsubifds=N on the full-res write tells tifffile to expect N sub-resolution levelssubfiletype=1 marks each subsequent write as a reduced-resolution imagebigtiff=True is required even though individual files may be < 4 GB (total IFD count can overflow)channel-name-parsing (CHANNELNAMES.txt parsing)