users > Reformat failure
Showing 1-19 of 19 posts
Display:
Results per page:
Oct 7, 2022  04:10 AM | Sheetal Potdar - Salk Institute for biological studies
Reformat failure
Hello,
I am trying to register brain to the JRF2018_U template on a windows 11 system. It says that the registration was successful, but failed to generate any reformatted images. Here are the complete details -

Started Affine and Warp Registration on 1 samples
Preset: Full Flybrain(Cachero-Ostrovksy_2010)

Affine parameters:
Initial affine method: --centers-of-mass
Affine registration metric: Normalized Mutual Information
Exploration [Initial optimizer step size]: 16
Accuracy [Final optimizer step size]: 0.8
Degrees of freedom first pass: 6
Degrees of freedom second pass: 9
Warp parameters:
Warp registration metric: Normalized Mutual Information
initial exploration step size: 26
Accuracy [Final exploration step size]: 0.4
coarsest resampling: 8
Refine grid: 4
grid size: 80
Job list:
fountain_2-8
(cmtk make_initial_affine --centers-of-mass /mnt/c/Users/sheet/OneDrive/Desktop/registration/refbrain/refbrain.nrrd /mnt/c/Users/sheet/OneDrive/Desktop/registration/images/fountain_2-8_01.nrrd /mnt/c/Users/sheet/OneDrive/Desktop/registration/images/fountain_2-8_Registration_2022-9-6-20-53/fountain_2-8_init.list; cmtk registration --initial /mnt/c/Users/sheet/OneDrive/Desktop/registration/images/fountain_2-8_Registration_2022-9-6-20-53/fountain_2-8_init.list --nmi --dofs 6 --dofs 9 --nmi --exploration 16 --accuracy 0.8 --omit-original-data -o /mnt/c/Users/sheet/OneDrive/Desktop/registration/images/fountain_2-8_Registration_2022-9-6-20-53/fountain_2-8_affine.list /mnt/c/Users/sheet/OneDrive/Desktop/registration/refbrain/refbrain.nrrd /mnt/c/Users/sheet/OneDrive/Desktop/registration/images/fountain_2-8_01.nrrd; cmtk warp --nmi --threads 159 --jacobian-weight 0 --fast -e 18 --grid-spacing 80 --energy-weight 1e-1 --refine 4 --coarsest 8 --ic-weight 0 --output-intermediate --accuracy 0.4 --omit-original-data -o /mnt/c/Users/sheet/OneDrive/Desktop/registration/images/fountain_2-8_Registration_2022-9-6-20-53/fountain_2-8_warp.list /mnt/c/Users/sheet/OneDrive/Desktop/registration/images/fountain_2-8_Registration_2022-9-6-20-53/fountain_2-8_affine.list;cmtk reformatx --pad-out 0 -o /mnt/c/Users/sheet/OneDrive/Desktop/registration/images/fountain_2-8_Registration_2022-9-6-20-53/Reformatted/warp_fountain_2-8_01.nrrd --floating /mnt/c/Users/sheet/OneDrive/Desktop/registration/images/fountain_2-8_01.nrrd /mnt/c/Users/sheet/OneDrive/Desktop/registration/refbrain/refbrain.nrrd /mnt/c/Users/sheet/OneDrive/Desktop/registration/images/fountain_2-8_Registration_2022-9-6-20-53/fountain_2-8_warp.list & cmtk reformatx --pad-out 0 -o /mnt/c/Users/sheet/OneDrive/Desktop/registration/images/fountain_2-8_Registration_2022-9-6-20-53/Reformatted/warp_fountain_2-8_02.nrrd --floating /mnt/c/Users/sheet/OneDrive/Desktop/registration/images/fountain_2-8_02.nrrd /mnt/c/Users/sheet/OneDrive/Desktop/registration/refbrain/refbrain.nrrd /mnt/c/Users/sheet/OneDrive/Desktop/registration/images/fountain_2-8_Registration_2022-9-6-20-53/fountain_2-8_warp.list & cmtk reformatx --pad-out 0 -o /mnt/c/Users/sheet/OneDrive/Desktop/registration/images/fountain_2-8_Registration_2022-9-6-20-53/Reformatted/warp_fountain_2-8_03.nrrd --floating /mnt/c/Users/sheet/OneDrive/Desktop/registration/images/fountain_2-8_03.nrrd /mnt/c/Users/sheet/OneDrive/Desktop/registration/refbrain/refbrain.nrrd /mnt/c/Users/sheet/OneDrive/Desktop/registration/images/fountain_2-8_Registration_2022-9-6-20-53/fountain_2-8_warp.list ) &
Please wait
execution time was 1705 s.
fountain_2-8 Registration was succesfull
Reformat failed:C:\Users\sheet\OneDrive\Desktop\registration\images\fountain_2-8_Registration_2022-9-6-20-53\Reformatted\warp_fountain_2-8_01.nrrd
Reformat failed:C:\Users\sheet\OneDrive\Desktop\registration\images\fountain_2-8_Registration_2022-9-6-20-53\Reformatted\warp_fountain_2-8_02.nrrd
Reformat failed:C:\Users\sheet\OneDrive\Desktop\registration\images\fountain_2-8_Registration_2022-9-6-20-53\Reformatted\warp_fountain_2-8_03.nrrd
Reformatted 0 images

Is there anything that I am missing? 

-Thanks
Sheetal
Oct 7, 2022  05:10 AM | Greg Jefferis
Reformat failure


Dear Sheetal,

Thanks for your interest in cmtk. I am afraid that the wrapper scripts have restrictions on names of input files. In particular they cannot have underscores (_) other than the underscore immediately preceding the channel number. So

file_01.nrrd is ok

But

file_2_01.nrrd

Won’t work at the reformat stage. Best,

Greg.

Oct 10, 2022  06:10 PM | Sheetal Potdar - Salk Institute for biological studies
RE: Reformat failure
Hi Greg,

Thank you for your response. I renamed my files as you suggested, however it still seems to be failing at the reformat stage. Could it be that my samples are not good enough? I am attaching .nrrd of the nc82 channel. 
Originally posted by Greg Jefferis:


Dear Sheetal,

Thanks for your interest in cmtk. I am afraid that the wrapper scripts have restrictions on names of input files. In particular they cannot have underscores (_) other than the underscore immediately preceding the channel number. So

file_01.nrrd is ok

But

file_2_01.nrrd

Won’t work at the reformat stage. Best,

Greg.

Oct 10, 2022  06:10 PM | Sheetal Potdar - Salk Institute for biological studies
RE: Reformat failure
Hi Greg,

Thank you for your response. I renamed my files as you suggested, however it still seems to be failing at the reformat stage. Could it be that my samples are not good enough? I am attaching .tif of the nc82 channel. 
Originally posted by Greg Jefferis:


Dear Sheetal,

Thanks for your interest in cmtk. I am afraid that the wrapper scripts have restrictions on names of input files. In particular they cannot have underscores (_) other than the underscore immediately preceding the channel number. So

file_01.nrrd is ok

But

file_2_01.nrrd

Won’t work at the reformat stage. Best,

Greg.

Oct 10, 2022  06:10 PM | Greg Jefferis
RE: Reformat failure


The problem is likely still the file names. Can you send a directory listing (eg ls -lR in the terminal)?

If you did not already do so, you should remove all the old outputs (including the registrations). Best, Greg.

Oct 11, 2022  08:10 AM | Sandor Kovacs
RE: Reformat failure
Hi,

I think file names could be ok, the script should just look for channel indicator after the last index of underscore. Could be write permission or other problems with onedrive folders, or the more likely explanation that your files are too big and wsl runs out of memory. 

to solve the memory problem : 

-close every window then open windows command line

- run the following command : wsl --shutdown

- open notepad type in the following but instead of x indicate the maximum amount of ram you can spare for wsl, for example if you have 16 GB type 14 

[wsl2]
memory=XGB # Limits VM memory in WSL 2 to X GB

-Very important to save the file as NOT a txt but "all files" type and name it exactly .wslconfig , now place this files to your user folder.


 
If it still doesn't work, To actually see whats happening copy the command from the log , the part between the parentheses, open the ubuntu terminal, right click and paste it then hit enter.
Oct 11, 2022  06:10 PM | Sheetal Potdar - Salk Institute for biological studies
RE: Reformat failure
Hi Greg and Sandor,
I performed all the steps you suggested, and used the test dataset provided here (https://www.dropbox.com/sh/54igm0xxmtlo4...).
With the test data also, I do not get any reformatted images.

As Sandor mentioned, I copied the log into the terminal and here is what it said - 

At line:1 char:1467
+ ... t_data/gehirn_Registration_2022-9-11-11-20/gehirn_warp.list & cmtk re ...
+ ~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double quotation marks ("&") to pass it as part of a string.
At line:1 char:1843
+ ... t_data/gehirn_Registration_2022-9-11-11-20/gehirn_warp.list & cmtk re ...
+ ~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double quotation marks ("&") to pass it as part of a string.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : AmpersandNotAllowed

Am I right in assuming this is in the .ijm code?
Oct 11, 2022  06:10 PM | Greg Jefferis
RE: Reformat failure
Hi Sheetal, I see you are using Sandor's script

https://github.com/sandorbx/Parallel-Fij...

so I am afraid that he will have to help you diagnose the issue. I thought you were using the original "munger" script distributed with CMTK and wrapped by

https://github.com/jefferis/fiji-cmtk-gu...

which has the restrictions I mentioned. Best wishes,

Greg.
Oct 11, 2022  07:10 PM | Sheetal Potdar - Salk Institute for biological studies
RE: Reformat failure
Hi Greg,

Apologies for the confusion. Correct me if I am wrong -- isn't the munger script specific for MacOSX?
Oct 11, 2022  08:10 PM | Sandor Kovacs
RE: Reformat failure
I think you tried the command in windows command line, instead open the windows subsystem linux terminal, for example if you installed ubuntu like in the instructions just start Ubuntu terminal from the search bar by start to type "ubuntu" and click on it.
Oct 12, 2022  05:10 PM | Sheetal Potdar - Salk Institute for biological studies
RE: Reformat failure
Hi Sandor,

I re-installed ubuntu (I think it wasn't installed correctly) and ran CMTK registration on the test data again. It returned reformatted images for channels 1 and 3. Here is what I found after pasting the log onto the ubuntu terminal - 

WARNING: image does not have valid orientation meta information; cannot reorient.
/usr/bin/cmtk: line 50: 1632 Killed ${CMDPATH} "$@"
WARNING: trying to change image coordinate space, but no current space is defined. Coordinate system of the resulting image is very likely incorrect.
WARNING: trying to change image coordinate space, but no current space is defined. Coordinate system of the resulting image is very likely incorrect.
[1]- Exit 137 cmtk reformatx --pad-out 0 -o /mnt/c/Users/sheet/Documents/test_data/gehirn_Registration_2022-9-11-15-47/Reformatted/warp_gehirn_01.nrrd --floating /mnt/c/Users/sheet/Documents/test_data/images/gehirn_01.PIC /mnt/c/Users/sheet/Documents/test_data/refbrain/JRC2018_UNISEX_20xHR.nrrd /mnt/c/Users/sheet/Documents/test_data/gehirn_Registration_2022-9-11-15-47/gehirn_warp.list

I performed the registration with my images, but I could neither register not reformat, but essentially got the same error.

WARNING: image does not have valid orientation meta information; cannot reorient.
/usr/bin/cmtk: line 50: 1845 Killed ${CMDPATH} "$@"
/usr/bin/cmtk: line 50: 1844 Killed ${CMDPATH} "$@"
[2]+ Exit 137 cmtk reformatx --pad-out 0 -o /mnt/c/Users/sheet/Documents/registration/file_Registration_2022-9-11-16-22/Reformatted/warp_file_02.nrrd --floating /mnt/c/Users/sheet/Documents/registration/images/file_02.nrrd /mnt/c/Users/sheet/Documents/registration/refbrain/refbrain.nrrd /mnt/c/Users/sheet/Documents/registration/file_Registration_2022-9-11-16-22/file_warp.list
spotdar@SheeDell:~$ WARNING: trying to change image coordinate space, but no current space is defined. Coordinate system of the resulting image is very likely incorrect.


[1]+ Done cmtk reformatx --pad-out 0 -o /mnt/c/Users/sheet/Documents/registration/file_Registration_2022-9-11-16-22/Reformatted/warp_file_01.nrrd --floating /mnt/c/Users/sheet/Documents/registration/images/file_01.nrrd /mnt/c/Users/sheet/Documents/registration/refbrain/refbrain.nrrd /mnt/c/Users/sheet/Documents/registration/file_Registration_2022-9-11-16-22/file_warp.list

Thoughts?
Oct 13, 2022  11:10 AM | Sandor Kovacs
RE: Reformat failure
Just share your reference channel file through dropbox or similar means  and I will take a look.
Oct 13, 2022  04:10 PM | Greg Jefferis
RE: Reformat failure
Just a note that these warnings are harmless and arise because the NRRD headers do not contain anatomical space information like LPS that is typically found in medical imaging data. Also for reference munger.pl is cross platform (ie linux and windows as well as mac, but depends on a perl installation).


I'll leave Sandor to follow up on the other points.

Best, Greg.
 

Originally posted by Sheetal Potdar:
WARNING: trying to change image coordinate space, but no current space is defined. Coordinate system of the resulting image is very likely incorrect.
WARNING: trying to change image coordinate space, but no current space is defined. Coordinate system of the resulting image is very likely incorrect.
Oct 13, 2022  06:10 PM | Sheetal Potdar - Salk Institute for biological studies
RE: Reformat failure
Originally posted by Sandor Kovacs:
Just share your reference channel file through dropbox or similar means  and I will take a look.
Hello Sandor,
Thank you for taking the time out to diagnose this issue.
You can find my image files here  - https://drive.google.com/drive/folders/1pVHRUb13Z2GOc8jSq4Y4wtNzahDOwlFX?usp=sharing

Let me know if the link doesn't work, or if you need any other information.
Oct 13, 2022  06:10 PM | Sheetal Potdar - Salk Institute for biological studies
RE: Reformat failure
Thanks Greg for the clarification!
Originally posted by Greg Jefferis:
Just a note that these warnings are harmless and arise because the NRRD headers do not contain anatomical space information like LPS that is typically found in medical imaging data. Also for reference munger.pl is cross platform (ie linux and windows as well as mac, but depends on a perl installation).


I'll leave Sandor to follow up on the other points.

Best, Greg.
 

Originally posted by Sheetal Potdar:
WARNING: trying to change image coordinate space, but no current space is defined. Coordinate system of the resulting image is very likely incorrect.
WARNING: trying to change image coordinate space, but no current space is defined. Coordinate system of the resulting image is very likely incorrect.
Oct 14, 2022  10:10 AM | Sandor Kovacs
RE: Reformat failure
Make sure when you run the GUI macro on your samples  the "skip final resolution step" checkbox  is unchecked  under computational options. You may have to use custom parameters for best results, but I attach your reformatted files registered with the preset. 


https://www.dropbox.com/sh/w6xevkfsiwzex...



Originally posted by Sheetal Potdar:
Originally posted by Sandor Kovacs:
Just share your reference channel file through dropbox or similar means  and I will take a look.
Hello Sandor,
Thank you for taking the time out to diagnose this issue.
You can find my image files here  - https://drive.google.com/drive/folders/1pVHRUb13Z2GOc8jSq4Y4wtNzahDOwlFX?usp=sharing

Let me know if the link doesn't work, or if you need any other information.
Oct 14, 2022  03:10 PM | Sheetal Potdar - Salk Institute for biological studies
RE: Reformat failure
Hi Sandor,
Thank you for the reformatted images.
Can you tell me what other parameters you changed (other than unchecking the last step box)? I just wanted to run this image again to ensure that I don't run into any other errors.
Best,
Sheetal
Originally posted by Sandor Kovacs:
Make sure when you run the GUI macro on your samples  the "skip final resolution step" checkbox  is unchecked  under computational options. You may have to use custom parameters for best results, but I attach your reformatted files registered with the preset. 


https://www.dropbox.com/sh/w6xevkfsiwzex...



Originally posted by Sheetal Potdar:
Originally posted by Sandor Kovacs:
Just share your reference channel file through dropbox or similar means  and I will take a look.
Hello Sandor,
Thank you for taking the time out to diagnose this issue.
You can find my image files here  - https://drive.google.com/drive/folders/1pVHRUb13Z2GOc8jSq4Y4wtNzahDOwlFX?usp=sharing

Let me know if the link doesn't work, or if you need any other information.
Oct 14, 2022  05:10 PM | Sandor Kovacs
RE: Reformat failure
I used the full flybrain preset without changing, presets are only determining the affine and warp parameters. Your samples are somewhat low resolution so they benefit from the final step of multi resolution alignment.
Oct 14, 2022  10:10 PM | Sheetal Potdar - Salk Institute for biological studies
RE: Reformat failure
OK, thank you so much for all the help!
Originally posted by Sandor Kovacs:
I used the full flybrain preset without changing, presets are only determining the affine and warp parameters. Your samples are somewhat low resolution so they benefit from the final step of multi resolution alignment.