View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003487 | Slicer4 | Module MultiVolume Exporter/Importer | public | 2013-11-08 04:03 | 2015-11-30 17:49 |
Reporter | liuy5 | Assigned To | fedorov | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | Slicer 4.3.0 | ||||
Target Version | Slicer 4.4.0 | Fixed in Version | Slicer 4.4.0 | ||
Summary | 0003487: incorret file name sorting in multivolume importer | ||||
Description | Have files like this: 1.dcm However multivolume importer sort files like this: 1.dcm These files are images at different time points so multivoulme importer messed up the whole dataset by changing order of time points. | ||||
Tags | No tags attached. | ||||
This is expected behavior, files are sorted by the importer in alphanumeric order. Please check the wiki documentation. |
|
No this should not be expected behaviour. Even file explorer in Linux can sort these files correctly: 1, 2, 3, ...10, 20,... instead of 1, 10, 2, 20, 3, 30... Which library are you using in importer? Is there an option to do correct file name sorting? Thanks, |
|
It is using sort() function of python. In [5]: l=['1','2','11','12'] Why can't you just rename your files to be numbered 01, 02, 03, ..., 10, 11 ? In [8]: l=['02','01','22','11'] |
|
2014-01-17 16:16
|
sort.py (685 bytes) |
The files are dumped using another software and it would too much work to manually change file names every time. I did a little bit search and turns out there are python ways to do "human sort". I have created a small python file to demonstrate the usage. The core part is simply 3 lines of code: def human_sort(l): Would you please to include this in your code to replace the default python sorting? It might be just 10 minutes work for you but it would save us lots of trouble. Plus it will make Slicer a lot user friendly. You may see the sort function in the attached python file. Many thanks! |
|
I committed your fix in r22835. Thank you for oyur contribution! |
|
Closing resolved issues that have not been updated in more than 3 months |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2013-11-08 04:03 | liuy5 | New Issue | |
2013-11-08 04:03 | liuy5 | Status | new => assigned |
2013-11-08 04:03 | liuy5 | Assigned To | => jcfr |
2013-11-08 06:03 | jcfr | Assigned To | jcfr => fedorov |
2013-11-08 06:03 | jcfr | Category | Core: Base Code => Module MultiVolumeImporter |
2013-11-08 06:04 | jcfr | Target Version | => Slicer 4.4.0 |
2013-11-08 06:26 | fedorov | Note Added: 0010297 | |
2013-11-08 07:03 | fedorov | Status | assigned => feedback |
2014-01-07 09:23 | liuy5 | Note Added: 0010485 | |
2014-01-07 13:26 | fedorov | Note Added: 0010488 | |
2014-01-17 16:16 | liuy5 | File Added: sort.py | |
2014-01-17 16:17 | liuy5 | Note Added: 0010526 | |
2014-01-18 08:25 | fedorov | Note Added: 0010527 | |
2014-01-18 08:25 | fedorov | Status | feedback => resolved |
2014-01-18 08:25 | fedorov | Resolution | open => fixed |
2014-04-07 14:53 | jcfr | Note Added: 0011550 | |
2014-04-07 14:53 | jcfr | Status | resolved => closed |
2014-04-07 14:53 | jcfr | Fixed in Version | => Slicer 4.4.0 |
2015-11-30 17:49 | jcfr | Category | Module MultiVolumeImporter => Module: MultiVolume Exporter/Importer |