BIC-MNI / minc-tools

Basic minc-tools from former minc repository
Other
30 stars 25 forks source link

minc_modify_header can't delete top-level variables #34

Open gdevenyi opened 8 years ago

gdevenyi commented 8 years ago

Not sure if this is a bug or a missing feature:

With a minc header such as:

<CLIP>
zspace = -39.3054472522805 ;

 acquisition = 0 ;

 dicom_0x0008 = 0 ;

 dicom_0x0009 = 0 ;

 dicom_0x0010 = 0 ;

 dicom_0x0018 = 0 ;

 dicom_0x0019 = 0 ;

 dicom_0x0020 = 0 ;

 dicom_0x0021 = 0 ;

 dicom_0x0023 = 0 ;

 dicom_0x0025 = 0 ;

 dicom_0x0027 = 0 ;

 dicom_0x0028 = 0 ;

 dicom_0x0029 = 0 ;

 dicom_0x0040 = 0 ;

 dicom_0x0043 = 0 ;

 dicom_0x0054 = 0 ;

 dicom_groups = 0 ;

 dicominfo = 0 ;

 patient = 0 ;

 study = 0 ;
}

I'd like to be able to delete these top-level dicom variables.

minc_modify_header -delete dicom_0x0018 17.mnc
-delete option requires argument <var>:<attr>
minc_modify_header -delete dicom_0x0018: 17.mnc
<no output, but variable still exists>

Is it possible to do this?

rdvincent commented 8 years ago

Not sure off the top of my head, but I assume it should work.

andrewjanke commented 8 years ago

If it's possible, I'm not aware of how. I once spent a large amount of time trying to get this to happen and in the end gave up, dumped the header to cdf, parsed it and then back to MINC to ensure things were gone when anonymising data. See mincanon and mincclean here:

https://github.com/BIC-MNI/minc-widgets/tree/master/mincanon

a

On 21 April 2016 at 07:29, Robert D Vincent notifications@github.com wrote:

Not sure off the top of my head, but I assume it should work.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/BIC-MNI/minc-tools/issues/34#issuecomment-212614235

rdvincent commented 8 years ago

there's some ability to delete things in HDF5. Possibly not in NetCDF. In neither case would I assume it would make the file smaller, or automatically overwrite the values (e.g. erase sensitive information).

gdevenyi commented 8 years ago

Well, mincanon and mincclean are exactly what I was trying to put togeather. So I guess my work is done :)

@andrewjanke expect an incoming patche for mincanon which uses a temp directory. I found that high speed read/writes using minc_modify_headers triggers a nasty bug in my NFSv4 systems