wenmin-wu/ds-skills/black-slice-replacement
Claude Code and agent skill by wenmin-wu/ds-skills
- community
Checking that the SKILL.md file is still in the repository.
Detect all-black DICOM/MRI slices (mean==0) and replace them by randomly sampling a non-black slice from the same series
Install
npx vskill@latest install wenmin-wu/ds-skills/black-slice-replacementSKILL.md
The same SKILL.md was published earlier as majiayu000/claude-skill-registry-data/black-slice-replacement.
Black Slice Replacement
Overview
Medical imaging volumes sometimes contain entirely black slices due to scanner artifacts, corrupt files, or padding. Feeding black slices into a model wastes capacity and can degrade training. Detecting slices with mean == 0 and replacing them with a randomly sampled non-black slice from the same series maintains the expected input shape while providing meaningful pixel data.
Quick Start
Workflow
- Load each slice from the series
- Check if
image.mean() == 0(all-black) - If black, randomly sample another slice from the same series
- Retry up to N times to avoid infinite loops on fully corrupt volumes
- Stack non-black slices into the output volume
Key Decisions
- Detection threshold:
mean == 0catches fully black; usemean < epsilonfor near-black - Replacement strategy: random sampling is simple; nearest non-black slice preserves spatial context better
- Max retries: cap at 100 to handle volumes where most slices are black
- vs zero-pad: replacement provides real texture; zero-pad is cleaner but less informative
References
- [[TF]: 3D & 2D Model for Brain Tumor Classification](https://www.kaggle.com/code/ipythonx/tf-3d-2d-model-for-brain-tumor-classification)
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cv/black-slice-replacement/SKILL.md
Popularity
- Repository stars
- 62
- Repository forks
- 4
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/wenmin-wu/ds-skills/black-slice-replacement)