Central naming rules for brain atlas files.
This class encapsulates all filename generation and parsing rules used by both built-in and custom atlases.
Canonical file layout
Given a stem consisting of:
<stem> = <prefix><animal>
Example stems:
invicroMouse
MyCustomRat
Mouse
the following filenames are generated:
<stem>Atlas.rmha
<stem>CT.mhd
<stem>CT.raw
<stem>Atlas-Key-AllRegions.csv
Scope
The active matching functions (used by SegmentationServiceNMCT to populate the atlas/animal combo boxes) only recognize names in the exact canonical form above – i.e. what CustomBrainAtlasWizard actually produces. Older files that omit the "Atlas" suffix or append a version tag after it (e.g. legacy invicroRatAtlas54.rmha) are not recognized; duplicate such files under a compliant name instead of relying on this class to parse them.
All filename creation functions produce the canonical naming format.
|
| static string | rmhaName (string stem) |
| | Builds the canonical ROI atlas filename.
|
| static string | anatName (string stem, string modality) |
| | Builds the canonical anatomical header filename.
|
| static string | rawName (string stem, string modality) |
| | Builds the canonical anatomical raw image filename.
|
| static string | keyName (string stem, string keyType) |
| | Builds the canonical atlas key filename.
|
| static string | stemOf (string prefix, string animal) |
| | Constructs an atlas stem.
|
| static string | stripAtlasSuffix (string s) |
| | Removes a trailing "Atlas" suffix.
|
| static bool | isEncryptedPrefix (string stemOrName) |
| | Determines whether an atlas should be treated as encrypted.
|
| static string | prefixPattern () |
| | Regular expression fragment matching a valid atlas prefix.
|
| static string | atlasSuffixPattern () |
| | Regular expression fragment matching the mandatory "Atlas" suffix used by .rmha and key file names.
|
| string atlasSuffixPattern |
( |
| ) |
|
|
static |
Regular expression fragment matching the mandatory "Atlas" suffix used by .rmha and key file names.
This is required, not optional: CustomBrainAtlasWizard always appends "Atlas" (see createNewAtlasCompleteInputs()), so this class only recognizes names that include it. It intentionally does not match older names that omitted "Atlas" or appended a version tag after it (e.g. legacy invicroRatAtlas54.rmha) – such files should be duplicated under a compliant name rather than accepted here.
Only use this for .rmha/key filenames. Anatomical (.mhd) file names never contain "Atlas" at all (see anatName()) and must not use this pattern.
- Returns
- Regular expression fragment.
Regular expression fragment matching a valid atlas prefix.
The pattern accepts letters, digits, underscores, periods, and hyphens.
This pattern is shared by all atlas discovery and parsing logic.
- Returns
- Regular expression fragment.