Gunzip files and delete

Can I define a function that unzips niftis on the fly while passing it on to the next node? That way I won’t have to have a folder full of unzipped files sitting there doing nothing. Alternatively, after the calculation was performed can I just delete the folder that isn’t needed?

The same question applies to gzipping files after SPM is done with them and then erase the non-zipped files.

nothing like this currently exists. we have considered this more generally in the context of an image converter, but even something as simple as zipping depends on sizes and software.

it’s possible to intercept this at the level of interface + node. and perhaps simply for the spm interfaces, they could be made to unzip on the fly and zip the output.

many file systems handle compression behind the scenes. perhaps consider looking into something like that as well.

it’s possible to intercept this at the level of interface + node. and perhaps simply for the spm interfaces, they could be made to unzip on the fly and zip the output.

Could you give me an example? Maybe I’ll do it like that.

How can I erase the files I don’t need in nipype?

when i meant about altering the interface, is that this would involve rewriting the SPMInputImage class to accept zipped images and convert on the fly.

nipype has a few config optons to control the working directory. the remove_unnecessary_outputs is true by default and prunes files that are not needed downstream from a node.