# Load Directory Leaves Off a File

**URL:** <https://discourse.slicer.org/t/load-directory-leaves-off-a-file/27356>\
**Category:** Support\
**Created:** [January 19, 2023, 4:35pm UTC](https://discourse.slicer.org/t/load-directory-leaves-off-a-file/27356 "2023-01-19T16:35:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rhodesdante](https://avatars.discourse-cdn.com/v4/letter/r/dec6dc/32.png) [@rhodesdante](https://discourse.slicer.org/u/rhodesdante)\
**Post date:** [January 19, 2023, 4:35pm UTC](https://discourse.slicer.org/t/load-directory-leaves-off-a-file/27356/1 "2023-01-19T16:35:40Z")

</div>

I was trying to use the Add Data → Choose Directory to Add button to load in some .nrrd files, but every time I try this, the loader always misses a single file. I checked the log, and it gives the error “There is more than one file, use the vtkITKArchetypeImageSeriesReader instead” as soon as the files begin to load. There is nothing unique in name or content about the file that is missing, and the others import just fine. Is this a bug in the importer? Thanks for your help

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [January 19, 2023, 4:43pm UTC](https://discourse.slicer.org/t/load-directory-leaves-off-a-file/27356/2 "2023-01-19T16:43:49Z")

</div>

Please let us know the names of the files in question. Sometimes the heuristics in the readers will try to treat multiple files as one volume to reflect the way some people organize their data across files (e.g. using filename numbers to indicate that a series of image files form a volume).

---

<div class="post-metadata">

**Author:** ![rhodesdante](https://avatars.discourse-cdn.com/v4/letter/r/dec6dc/32.png) [@rhodesdante](https://discourse.slicer.org/u/rhodesdante)\
**Post date:** [January 19, 2023, 5:16pm UTC](https://discourse.slicer.org/t/load-directory-leaves-off-a-file/27356/3 "2023-01-19T17:16:40Z")

</div>

I wasn’t able to load in exactly the same files, but I found a new set and posted their names below. I had a similar issue in that the files “PatientX\_RLGB\_Long\_plac1\_vol2\_diag” and “PatientX\_RLGB\_Long\_plac1\_vol3\_diag” were missing, though this time no error was thrown.

PatientX\_RLGB\_Long\_plac1\_vol1\_diag.nrrd  
PatientX\_RLGB\_Long\_plac1\_vol1\_MPLL.nrrd  
PatientX\_RLGB\_Long\_plac1\_vol2\_diag.nrrd  
PatientX\_RLGB\_Long\_plac1\_vol2\_MPLL.nrrd  
PatientX\_RLGB\_Long\_plac1\_vol3\_diag.nrrd  
PatientX\_RLGB\_Long\_plac1\_vol3\_MPLL.nrrd  
PatientX\_RLGB\_Long\_plac2\_vol1\_diag.nrrd  
PatientX\_RLGB\_Long\_plac2\_vol1\_MPLL.nrrd  
PatientX\_RLGB\_Long\_plac2\_vol2\_diag.nrrd  
PatientX\_RLGB\_Long\_plac2\_vol2\_MPLL.nrrd  
PatientX\_RLGB\_Long\_plac2\_vol3\_diag.nrrd  
PatientX\_RLGB\_Long\_plac2\_vol3\_MPLL.nrrd  
PatientX\_RLGB\_Long\_plac3\_vol1\_MPLL.nrrd  
PatientX\_RLGB\_Long\_plac3\_vol2\_MPLL.nrrd  
PatientX\_RLGB\_Long\_plac3\_vol3\_MPLL.nrrd  
PatientX\_RLGB\_Long\_plac4\_vol1\_MPLL.nrrd  
PatientX\_RLGB\_Long\_plac4\_vol2\_MPLL.nrrd  
PatientX\_RLGB\_Long\_plac4\_vol3\_MPLL.nrrd  
PatientX\_RLGB\_Transverse\_plac1\_vol1\_diag.nrrd  
PatientX\_RLGB\_Transverse\_plac1\_vol1\_MPLL.nrrd  
PatientX\_RLGB\_Transverse\_plac1\_vol2\_diag.nrrd  
PatientX\_RLGB\_Transverse\_plac1\_vol2\_MPLL.nrrd  
PatientX\_RLGB\_Transverse\_plac1\_vol3\_diag.nrrd  
PatientX\_RLGB\_Transverse\_plac1\_vol3\_MPLL.nrrd  
PatientX\_RLGB\_Transverse\_plac2\_vol1\_diag.nrrd  
PatientX\_RLGB\_Transverse\_plac2\_vol1\_MPLL.nrrd  
PatientX\_RLGB\_Transverse\_plac2\_vol2\_diag.nrrd  
PatientX\_RLGB\_Transverse\_plac2\_vol2\_MPLL.nrrd  
PatientX\_RLGB\_Transverse\_plac2\_vol3\_diag.nrrd  
PatientX\_RLGB\_Transverse\_plac2\_vol3\_MPLL.nrrd  
PatientX\_RLGB\_Transverse\_plac3\_vol1\_MPLL.nrrd  
PatientX\_RLGB\_Transverse\_plac3\_vol2\_MPLL.nrrd  
PatientX\_RLGB\_Transverse\_plac3\_vol3\_MPLL.nrrd  
PatientX\_RLGB\_Transverse\_plac4\_vol1\_MPLL.nrrd  
PatientX\_RLGB\_Transverse\_plac4\_vol2\_MPLL.nrrd  
PatientX\_RLGB\_Transverse\_plac4\_vol3\_MPLL.nrrd

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [January 19, 2023, 6:54pm UTC](https://discourse.slicer.org/t/load-directory-leaves-off-a-file/27356/4 "2023-01-19T18:54:42Z")

</div>

yes, these are the kinds of filenames that may trigger the grouping heuristics. Probably the easiest is to just put the files into separate directories to load.

---

<div class="post-metadata">

**Author:** ![rhodesdante](https://avatars.discourse-cdn.com/v4/letter/r/dec6dc/32.png) [@rhodesdante](https://discourse.slicer.org/u/rhodesdante)\
**Post date:** [January 19, 2023, 9:17pm UTC](https://discourse.slicer.org/t/load-directory-leaves-off-a-file/27356/5 "2023-01-19T21:17:18Z")

</div>

I appreciate the information that these kinds of filenames trigger grouping heuristics. For my use case, it would be best if the files could be in the same directory. Are there any specific rules about filenames that I can consider so I don’t set off the grouping heuristics during load? Thanks!

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [January 19, 2023, 9:34pm UTC](https://discourse.slicer.org/t/load-directory-leaves-off-a-file/27356/6 "2023-01-19T21:34:43Z")

</div>

Yeah, I don’t like the heuristics much either but they are buried deep in some of the code to support some edge use cases in the community of 20 or so years ago. Maybe it’s time form them to be turned off or made optional. If you could file an issue github with a description of the problem and the example files that were problematic for you it would stay on the radar, but FYI we don’t currently have dedicated funding for fixes at that level.

For now, one option could be to use a custom load function in python to copy the files to individual temp directories before loading. This is just a few lines of code and probably won’t add much overhead unless your files are very large.
